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

spawnFunction with isolate exception handler never catches IsolateUnhandledException #11505

Closed
DartBot opened this issue Jun 25, 2013 · 5 comments
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. closed-obsolete Closed as the reported issue is no longer relevant

Comments

@DartBot
Copy link

DartBot commented Jun 25, 2013

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
Copy link
Contributor

dgrove commented Jun 25, 2013

Added Area-Library, Triaged labels.

@nex3
Copy link
Member

nex3 commented Aug 23, 2013

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

@floitschG
Copy link
Contributor

new isolate API doesn't provide handleException argument anymore.


Added AssumedStale label.

@nex3
Copy link
Member

nex3 commented Nov 5, 2013

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

@floitschG
Copy link
Contributor

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).

@DartBot DartBot added Type-Defect area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. closed-obsolete Closed as the reported issue is no longer relevant labels Nov 5, 2013
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. closed-obsolete Closed as the reported issue is no longer relevant
Projects
None yet
Development

No branches or pull requests

4 participants