How to handle exceptions thrown in Isolates?


I’m experimenting with Dart and using the new streamSpawnFunction to create a new isolate.

I’m running my code in Dartium but i’ve noticed that if some kind of unrecoverable error occurs in the isolate i get no error message on the console. Because breakpoints in Isolate code are not working debugging is really painful.

The old Port based Isolate spawn function (spawnFunction) has a callback function for handling errors. I wonder why this is not available with streamSpawnFunction. Is there a new way to subscribe to the error events of an Isolate?


The missing functionality of streamSpawnFunction is just an oversight. I filed and I will try to fix it next week.

I’m not sure if it is a known problem that breakpoints don’t work in isolates. I will let you file a bug-report ( so the devs can ask you questions and you are kept informed on the process.

Answered By – Florian Loitsch

Answer Checked By – Marie Seifert (FlutterFixes Admin)

Leave a Reply

Your email address will not be published. Required fields are marked *