Throwing an exception while handling an exception
- by FredOverflow
If a destructor throws in C++ during stack unwinding caused by an exception, the program terminates. (That's why destructors should never throw in C++.)
If a finally block is entered in Java because of an exception in the corresponding try block and that finally block throws another exception, the first exception is silently swallowed.
This question crossed my mind: Could a programming language handle multiple exceptions being thrown at the same time? Would that be useful? Have you ever missed that ability? Is there a language that already supports this? Is there any experience with such an approach?
Any thoughts?