I saw this code in ThreadCallbacks:
static function iterateCallbacks<F>(callbacks:Array<ThreadCallback<F>>, f:ThreadCallback<F> -> Void) {
var firstException = null;
for (c in callbacks) {
if (!c.isClosed) {
try {
f(c);
} catch(e:Exception) {
if (firstException == null) {
firstException = e;
}
}
}
}
if (firstException != null) {
throw firstException;
}
}
I think it's a very bad idea for several reasons
- it prevents the debugger from breaking at the place you have an exception, you're instead breaking on the
throw firstException
- it somehow discard all user exceptions happening after the first one, which is really a bad behavior from the user point of view.
In general, the whole "exception during abort or exit which triggers onAbort" is not very well thought through.
I saw this code in ThreadCallbacks:
I think it's a very bad idea for several reasons
throw firstExceptionIn general, the whole "exception during abort or exit which triggers onAbort" is not very well thought through.