G
Goran Pusic
Hm, I am not so sure about that. It very much depends on how religiously and
locally you handle exceptions. On one extreme end, you let everything
propagate to the top-level and have one catch-all block. On the other end of
the spectrum, you can handle each exception as early as possible. In the
later case, you will still have a sizable number of catch blocks.
My question to you is, why do you want to handle exceptions locally?
Give some examples, or better yet, don't, just look at your own code
and count try/catch-es ;-).
If you use RAII /scope guard, try/catches are of two sorts:
1. report the error and continue working (or, for top-level catch in
main, exit)
2. re-throw the error with additional info.
1. is extremely rare, for example, top-level try/catch in main or any
thread function, or, in a GUI event loop, on the said loop, or on
similar loops elsewhere, where your mode of operation is "loop
until....", and you dont' want to terminate a loop due to an error in
one iteration.
2. is more common, but depends on how precise you can be at the actual
throw site, and how much you want to add while unwinding the stack.
Goran.