-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Poor error handling in Dartium isolates #10222
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This comment was originally written by [email protected]
Corner case of the implementation: child isolate dies too early. Please, file a separate bug.
Please, file a separate bug.
I don't think it's a default behaviour for JS in Chromium.
|
I'm sorry, but the experience totally sucks, that is the topic of this bug. If you need to divide the work into several issues, please do so. As far as I can tell, there is no way to get the debugger to pause on exceptions in isolates. Even setting a breakpoint has no effect. FWIW, the JS chrome behavior for web workers is also horrible. I hope we set the bar higher in Dart. But it is at least possible to get JS/chrome to break on all exceptions in workers. |
This comment was originally written by [email protected] Added this to the Later milestone. |
Removed this from the Later milestone. |
Removed Oldschool-Milestone-Later label. |
Consider this program:
import 'dart:isolate';
import 'dart:html' show HttpRequest;
useHttpRequest() {
print('In isolate.');
HttpRequest.getString('test.dart').then((text) => print(text));
}
main() {
print('Starting isolate');
spawnFunction(useHttpRequest);
}
All that shows up in the console is:
"Starting isolate undefined:1"
I had expected to see:
"Starting isolate test.dart:10
[From isolate] In isolate. test.dart:5
[From isolate] DOM access is not enabled in this isolate
0 HttpRequest._create (file:///Volumes/data/b/build/slave/dartium-mac-inc/build/src/out/Release/gen/webkit/bindings/dart/dart/html/HttpRequest.dart:60:3)
1 HttpRequest.HttpRequest (file:///Volumes/data/b/build/slave/dartium-mac-inc/build/src/out/Release/gen/webkit/bindings/dart/dart/html/HttpRequest.dart:58:35)
2 HttpRequest.request (file:///Volumes/data/b/build/slave/dartium-mac-inc/build/src/out/Release/gen/webkit/bindings/dart/dart/html/HttpRequest.dart:10:15)
3 HttpRequest.getString (file:///Volumes/data/b/build/slave/dartium-mac-inc/build/src/out/Release/gen/webkit/bindings/dart/dart/html/HttpRequest.dart:5:19)
4 useHttpRequest (http://127.0.0.1:56653/web_editor/test.dart:6:26)
This is almost what happens if I modify useHttpRequest:
useHttpRequest() {
print('In isolate.');
try {
HttpRequest.getString('test.dart').then((text) => print(text));
} catch (e, trace) {
print('$e\n$trace');
}
}
So the following questions arise:
I'll file a separate bug about HttpRequest not being available.
The text was updated successfully, but these errors were encountered: