Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

spawnFunction with isolate exception handler never catches IsolateUnhandledException #11505

DartBot opened this Issue Jun 25, 2013 · 5 comments


None yet
4 participants

DartBot commented Jun 25, 2013

This issue was originally filed by @chrisbu

What steps will reproduce the problem?

  1. Write Code such as:

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: (Fri Jun 21 05:02:50 2013) on "macos_x64"

Please provide any additional information below.

Taken from SO question:

which was raised in response to SO question:


dgrove commented Jun 25, 2013

Added Area-Library, Triaged labels.


nex3 commented Aug 23, 2013

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


floitschG commented Nov 5, 2013

new isolate API doesn't provide handleException argument anymore.

Added AssumedStale label.


nex3 commented Nov 5, 2013

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


floitschG commented Nov 5, 2013

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