The Source for Java Technology Collaboration
User: Password:



Start New Message Delete Post a Reply

Article: 
 Three Rules for Effective Exception Handling
Subject:  Catching Errors
Date:  2003-12-05 10:14:09
From:  jimothy
Response to: Rethrowing exceptions is not the best idea....


According to the Javadocs, "An Error...indicates serious problems that a reasonable application should not try to catch."

Catching Error or Throwable is dangerous. For example, if you do catch an OutOfMemoryError, what are you going to do about it? Trying to recover could lead to further OutOfMemoryErrors.

 Feed java.net RSS Feeds