Skip to content
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

Poor error handling in Dartium isolates #10222

Closed
peter-ahe-google opened this issue Apr 26, 2013 · 5 comments
Closed

Poor error handling in Dartium isolates #10222

peter-ahe-google opened this issue Apr 26, 2013 · 5 comments
Labels
P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@peter-ahe-google
Copy link
Contributor

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:

  1. Why isn't the the text "In isolate" printed in the console?
  2. Why isn't the uncaught exception diagnosed?
  3. Why doesn't the debugger pause on the exception?
  4. Why does the console say "undefined:1"?

I'll file a separate bug about HttpRequest not being available.

@DartBot
Copy link

DartBot commented Apr 26, 2013

This comment was originally written by antonm@google.com


  1. Why isn't the the text "In isolate" printed in the console?

Corner case of the implementation: child isolate dies too early. Please, file a separate bug.

  1. Why isn't the uncaught exception diagnosed?

Please, file a separate bug.

  1. Why doesn't the debugger pause on the exception?

I don't think it's a default behaviour for JS in Chromium.

  1. Why does the console say "undefined:1"?

See https://code.google.com/p/dart/issues/detail?id=5851

@peter-ahe-google
Copy link
Contributor Author

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.

@DartBot
Copy link

DartBot commented May 29, 2013

This comment was originally written by antonm@google.com


Added this to the Later milestone.

@kasperl
Copy link

kasperl commented Jul 10, 2014

Removed this from the Later milestone.
Added Oldschool-Milestone-Later label.

@kasperl
Copy link

kasperl commented Aug 4, 2014

Removed Oldschool-Milestone-Later label.

@kevmoo kevmoo added P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) and removed triaged labels Feb 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

5 participants