Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

spawnFunction with isolate exception handler never catches IsolateUnhandledException #11505

Closed
DartBot opened this Issue · 5 comments

4 participants

@DartBot
Collaborator

This issue was originally filed by @chrisbu


What steps will reproduce the problem?
1. Write Code such as:
http://stackoverflow.com/questions/17292762/dart-unhandledexceptioncallback-is-ignored

import 'dart:isolate';

void isolateMain() {
  throw new Exception("ouch");
}

bool handleException(IsolateUnhandledException e) {
  print("EXCEPTION in isolate: " + e.toString());
  return true;
}

void main() {
  SendPort sendPort = spawnFunction(isolateMain, handleException);
  sendPort.call("Hello").then((e) {
    print("Main received " + e);
  });
}

  1. handleException function is never called.

What is the expected output? What do you see instead?

Expect handleException to be called.

What version of the product are you using? On what operating system?

Dart VM version: 0.5.20.4_r24275 (Fri Jun 21 05:02:50 2013) on "macos_x64"

Please provide any additional information below.

Taken from SO question:
http://stackoverflow.com/questions/17292762/dart-unhandledexceptioncallback-is-ignored

which was raised in response to SO question:
http://stackoverflow.com/questions/17271178/dart-web-server-prevent-crash/17271530#­17271530

@dgrove
Owner

Added Area-Library, Triaged labels.

@nex3
Owner

This is also making our lives difficult for implementing the pub/barback plugin architecture.

@floitschG
Collaborator

new isolate API doesn't provide handleException argument anymore.


Added AssumedStale label.

@nex3
Owner

Are there plans for another way to handle uncaught exceptions in isolates?

@floitschG
Collaborator

The plan is to use the returned isolate object (from Isolate.spawn{Uri}) to send a control message to the isolate. This control message will indicate that uncaught exceptions are not fatal. We are also looking into ways to retrieve the uncaught errors (probably a different control message).

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.