...
Because exceptions introduce code paths into a program, it is important to consider the effects of code taking such paths and to avoid any undesirable effects that might arise otherwise. Some such effects include failure to release an acquired resource, thereby introducing a leak, and failure to reestablish a class invariant after a partial update to an object or even a partial object update while maintaining all invariants. Code that avoids any such undesirable effects is said to be exception safe.
Based on the preceding effects, the following table distinguishes three kinds of exception safety guarantee from most to least desired:
...
SEI CERT C++ Coding Standard | ERR51-CPP. Handle all exceptions |
MITRE CWE | CWE-703, Failure to Handle Exceptional Conditions |
Bibliography
[ISO/IEC 14882-2014] | Clause 15, "Exception Handling" |
[Stroustrup 01] | |
[Sutter 00] | |
[Sutter 01] | |
[Sutter 04] | 55. "Prefer the canonical form of assignment." |
...