4 ms·
You manifestly don't care what the destination of an exception is. Aggressively so. The only choice to make is: here, or not here. If here is at a high enough
by ncmncm 4y ago
You manifestly don't care what the destination of an exception is. Aggressively so.
The only choice to make is: here, or not here. If here is at a high enough level to do something intelligent about it, catch it. If not, it is not your problem: there is nothing to be done, so you do that.
Generally, a good program will have very few places where exceptions are caught, and the code there is easily exercised and well tested. The destructors that run on the way there are also well exercised because they run with or without exceptions. Beware code that only ever runs in exceptional cases. It grows bugs when what was correct becomes wrong as the code changes around it.