Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Report unhandled exceptions of sunk
start blocks
In 6.d only. They are reported using the `handle_uncaught` method of
the scheduler the code was run under, providing a way to handle such
application-level errors (and also to test this functionality).
Since this is done with the `sink` method, then something like:
sub foo() { start deadly-stuff() }
foo();
Will, provided the call `foo()` is itself in sink context, result in
the exception being reported. This is a slight divergence from the
original idea of making it entirely syntactic, but will catch more
cases. Some things can be multiply sunk; there's a check to make sure
we only attach one handler, and this also means we are robust if we
just ever end up sinking a Promise we already did attach a handler to
somehow.
The new adverb to `start`, and indeed Promise construction, is for now
considered an implementation detail, however we might want to consider
it for inclusion in 6.e - perhaps with a different name, but I couldn't
think of anything shorter than communicated what it does decently. So,
for now it's unspecified.- Loading branch information