Description
See flutter/devtools#5883 for discussion.
There are several issues where users were confused by the the "Break on all exceptions" option when an exception is thrown in core library code and handled in core library code, e.g.
#52615
#52423
If an exception is thrown in code that is not debuggable and will be caught in code that is not debuggable, then the debugger should not break even if "Break on all exceptions" is enabled.
For example:
part of dart.core
void _foo() {
throw Exception('foo');
}
void bar() {
try {
_foo();
} on Exception {};
}
Calling bar
should not cause the debugger to break on throw Exception('foo');
because the exception is both thrown and caught in undebuggable code i.e. it is just an implementation detail of bar
.
Another example:
part of dart.core
void _foo() {
throw Exception('foo');
}
void bar() {
_foo();
}
// User code:
void main() {
try {
bar();
} on Exception {}
}
Calling bar
should cause the debugger to break on throw Exception('foo');
because the exception is caught in debuggable code.