Exception chaining: Difference between revisions

Content deleted Content added
No edit summary
copy edit and clarify
Line 1:
'''Exception chaining''', AKAor '''exception wrapping''', is an [[object-oriented programming]] technique of wrapping [[exception handling|exceptions]] intoin new exceptions by saving the original exception, i.e. as a property (such as '''Cause'cause'') propertyof the new exception. The idea is that a method should throw exceptions defined at the same abstraction level as the method itself, but without discarding important debugging information.
This way is particularily enforced by [[Checked_exceptions]] in [[Java_language]].
 
Throwing the right kind of exceptions is particularily enforced by [[exception handling#Checked exceptions|checked exceptions]] in the [[Java programming language]], and starting with language version 1.4 all exceptions support chaining.
[http://www.javaworld.com/javaworld/jw-09-2001/jw-0914-exceptions.html '''Exceptional practices''' by Brian Goetz at javaworld.com]
 
== References ==
 
* [http://www.javaworld.com/javaworld/jw-09-2001/jw-0914-exceptions.html '''Exceptional practices'''] by Brian Goetz at javaworld.com]
 
[[Category:Software design patterns]]