|
2.3 Built-in Exceptions (1800 words) |
 | The string value of all built-in exceptions is their name, but this is not a requirement for user-defined exceptions or exceptions defined by library modules. |
 | This can be used to test an exception handler or to report an error condition ``just like'' the situation in which the interpreter raises the same exception; but beware that there is nothing to prevent user code from raising an inappropriate error. |
 | All built-in, non-system-exiting exceptions are derived from this class. |
|
Java theory and practice: The exceptions debate (2503 words) |
 | Exception chaining can be used to throw a more appropriate exception without throwing away the details (such as the stack trace) of the underlying failure, allowing abstract layers to insulate the layers above them from the details of the layers below them while preserving information that might be useful for debugging. |
 | Exceptions were supposed to make code smaller by centralizing error handling, but a method with three lines of code and six catch blocks (each of which either just logs the exception or wraps and rethrows it) seems kind of bloated and can obfuscate otherwise simple code. |
 | Having used exceptions in C++, where all exceptions are unchecked, I have found that one of the biggest risks of unchecked exceptions is that they are not self-documenting in the way checked exceptions are. |