r/cpp • u/pavel_v • Apr 02 '26
What happens when a destructor throws
https://www.sandordargo.com/blog/2026/04/01/when-a-destructor-throws
102
Upvotes
r/cpp • u/pavel_v • Apr 02 '26
View all comments
Show parent comment
2
u/fluorihammastahna Apr 02 '26
In my quite radical opinion, exceptions should only be caught to rethrow a more informative exception, or at the top level to record troubleshooting data before exiting with a known error code. Fault-tolerant programs should be used in very exceptional (heh) occasions.
If your except that some exception is thrown during execution... Then it is not an exception! Design around it.
(I am saying this weeks after being lazy and using exceptions to handle malformed but tolerable input error, so I'm scolding myself here...)