4 ms·
One of the reasons why exceptions are difficult to use well is because of the guarantee you offer when you raise one. What happens when your function raises an
by shin_lao 17y ago
One of the reasons why exceptions are difficult to use well is because of the guarantee you offer when you raise one.
What happens when your function raises an exception?
Rollback?
Undefined?
That's the real difficulty.
More information here: http://blogs.msdn.com/oldnewthing/archive/2004/04/22/118161.aspx http://blogs.msdn.com/oldnewthing/archive/2004/04/22/118161....
- barrkel 17y agoGuarantees in the case of error is an orthogonal issue. The same problem exists for error codes. In fact, I see exceptions as a formalization of an extremely rigorous approach to error codes, where in the case of a failure the error codes is immediately propagated to the callers after local cleanup.