Skip to content


Subversion checkout URL

You can clone with
Download ZIP


spawnFunction with isolate exception handler never catches IsolateUnhandledException #11505

DartBot opened this Issue · 5 comments

4 participants


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);"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:­17271530


Added Area-Library, Triaged labels.


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


new isolate API doesn't provide handleException argument anymore.

Added AssumedStale label.


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


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.