haxetink / tink_await

Haxe async/await
MIT License
58 stars 15 forks source link

Arbitrary exception inside of a @async is not thrown or wrapped into an tink.core.Error #43

Open nodiex-cloud opened 3 years ago

nodiex-cloud commented 3 years ago

If there is null pointer exception in:

@async function myFunc() {
    var v:Dynamic=null;
    v.helloWorld();
}
try {
    @await myFunc();
} catch(e:Dynamic) {
    trace(e);
}

Nothing is caught or thrown by @await myFunc(). This is contrary to my understanding of the following from the documentation: Any exception results in a Failure, which will pass through all methods until caught

In addition, haxe complains with Catch class parameter must be Dynamic, if you do catch(e:tink.core.Error). It isn't clear if this would help in catching some, I doubt it. It seems like something is eating the exception. Manually executing the myFunc() with myFunc().handle doesn't see any exceptions either.