Exception Handling
- slide 26 : 30
Raising an exception in an exception handler
Inside a handler
, you can either rethrow an exception or raise/throw a new exception
Raising and throwing a new exception
Use this approach if you, of some reason, want to hide the original exception
Security, simplicity, ...
Consider propagation of the inner exception
Raising and throwing a new exception.
Output from the program that raises a new exception.
Raising and throwing a new exception, propagating original inner exception.
Output from the program that raises a new exception, with inner exception.