https://issues.dlang.org/show_bug.cgi?id=19602

--- Comment #12 from Eyal <e...@weka.io> ---
Walter, the question is: what benefits does the current approach have over a
much safer approach of having *only* "onError" callbacks that allow the user to
write some handling code in case of error before abort?

1) Even if the unwinding behavior is fixed to not unwind in case of errors,
using "catch" blocks to handle errors has very surprising semantics: it runs
code in broken contexts that have not run (scope(exit)s, finally's, destructors
all skipped).

2) Worse still: the program easily continues after catching Errors, even if it
is by accident -- in a completely corrupt state.

These would remain 2 huge gotchas to know about when working with try/catch.

Why keep them?

--

Reply via email to