On the one hand, Exceptions are implemented in the Library, not in the language - how can they create exceptions in the library? I am sure that you are not upholding that system libraries should have a different set of rules.
Otherwise, you can actually use the tree of exception objects. Inherited exceptions can have special attributes, if you want - they can be used for more complex things than they are. I am not a supporter of their use as a general mechanism for transmitting data or something else (although they may be), but I could see a case where someone implemented their own logging solution that required a special attribute in Exception ...
Your custom exceptions may contain a flag indicating a special appeal (perhaps one message that you should restart the JVM), they may contain information about logging levels, a bunch of things.
In any case, I am not a supporter of this, I just say that this is possible. The first paragraph is the real answer.
Bill K Jan 06 '09 at 17:36 2009-01-06 17:36
source share