You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
jellynoone opened this issue
Jan 31, 2024
· 6 comments
Assignees
Labels
area-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.P2A bug or feature request we're likely to work ontriagedIssue has been triaged by sub team
voidmain() async {
_stream().listen(print, onError: print);
}
Stream<int> _stream() async* {
for (var i =0; i <10; i++) {
yield i;
}
throwException('Debugger always treats it as uncaught!');
}
Steps to reproduce:
Run dart run --observe --pause-isolates-on-start streams.dart
Open DevTools debugger
Select Stop on uncaught exceptions
Continue
Observe the debugger stop at throw even though the error is handled via listen.
However, if we rewrite the example to:
voidmain() async {
try {
awaitfor (var item in_stream()) {
print(item);
}
} catch (e) {
print(e);
}
}
Stream<int> _stream() async* {
for (var i =0; i <10; i++) {
yield i;
}
throwException('Debugger always treats it as uncaught!');
}
The debugger does not pause. As expected...
If we yet again, however, rewrite the example to use .asBroadcastStream():
voidmain() async {
try {
awaitfor (var item in_stream().asBroadcastStream()) {
print(item);
}
} catch (e) {
print(e);
}
}
Stream<int> _stream() async* {
for (var i =0; i <10; i++) {
yield i;
}
throwException('Debugger always treats it as uncaught!');
}
There is a pause again on the throw.
Personally, I've encountered this issue when using some firebase packages, and
thinking I did some error handling wrong, only to figure out after some time,
that the errors were in fact handled, but the debugger reported them as not.
Dart version: Dart SDK version: 3.2.6 (stable) (Wed Jan 24 13:41:58 2024 +0000) on "macos_arm64"
The text was updated successfully, but these errors were encountered:
I have been sitting on a CL which should help here, but I have been delaying landing it because I have been slowly thinking through what we should even do with this? question.
area-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.P2A bug or feature request we're likely to work ontriagedIssue has been triaged by sub team
Consider the following example:
Steps to reproduce:
dart run --observe --pause-isolates-on-start streams.dart
Stop on uncaught exceptions
However, if we rewrite the example to:
The debugger does not pause. As expected...
If we yet again, however, rewrite the example to use
.asBroadcastStream()
:There is a pause again on the throw.
Personally, I've encountered this issue when using some firebase packages, and
thinking I did some error handling wrong, only to figure out after some time,
that the errors were in fact handled, but the debugger reported them as not.
Dart version:
Dart SDK version: 3.2.6 (stable) (Wed Jan 24 13:41:58 2024 +0000) on "macos_arm64"
The text was updated successfully, but these errors were encountered: