3 ms·
> separates exceptional situations from in-band normal error handling Of course if you redefine "exceptional" to mean out of band error handling then we're in
by KayEss 11y ago
> separates exceptional situations from in-band normal error handling
Of course if you redefine "exceptional" to mean out of band error handling then we're in perfect agreement :)
I've also written billing systems and the worst possible thing that happens is that you get stuck on a single customer due to some unforeseen circumstances and can't go on to bill others. The ability to abort the in-code transaction for that customer and move on to the next is exactly what you want from the system, and the exception there makes that a far simpler thing to do (together with RAII for clean up).
> function that both returns values and throws exceptions is more complex
Indeed, but it doesn't really matter because the clean up you get from exceptions with RAII means that the correctness of the function is easier to reason about and that's what you really care about.