Description
See https://dartpad.dev/?id=8d902660cb95b6e9eb87343b6bf1f198
I was playing around with "cancelling" async tasks by running them in zones, and wrapping all registered callbacks with a function that throws an exception if the task has been cancelled. Then I want to catch those specific exceptions and not bubble them up outside the zone. I am sure more needs to happen here to deal with edge cases and timers, but I was hoping this could work as a proof of concept.
However, I am unable to handle the errors thrown inside these callbacks, they don't reach the handleUncaughtError
handler in the zone, even though I can see that I am currently running inside the forked zone (and its also the error zone) right before throwing.
Is this intended behavior? Is it not possible to do what I want here?