Dreckr / Worker

Utility for easy concurrency with isolates
MIT License
35 stars 10 forks source link

Unknown classes, functions, variables in execute cause uninformative failure #7

Closed dkornishev closed 10 years ago

dkornishev commented 10 years ago
Future execute() {
    run = a; // boom
  }

In normal context, runtime issues a helpful message saying variables/classes/functions are not found.

When running via worker: Illegal argument(s): Illegal argument in isolate message : (object is a stacktrace)

Dreckr commented 10 years ago

Hi, Danil! Thanks for reporting.

The problem is that Dart does not allow stacktraces to be passed in Isolate messages and Errors have stacktraces attached to them (where Exceptions do not). What I can do is stringify the stackTrace and the error message, wrap them around an object and pass them back.

Dreckr commented 10 years ago

There's a library called 'stack_trace' that allows stackTrace manipulation. Using it I was able to make stackTraces serializable.

This bug is fixed on 0.3.9! Cheers!

dkornishev commented 10 years ago

Nice! Yeah, dart is weird on what it allows to go cross isolates. I would love for functions to be passable, but alas On Jun 14, 2014 1:54 PM, "Diego Rocha" notifications@github.com wrote:

Closed #7 https://github.com/Dreckr/Worker/issues/7.

— Reply to this email directly or view it on GitHub https://github.com/Dreckr/Worker/issues/7#event-131441288.