haxetink / tink_await

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

Another bug of capturing error #27

Closed andyli closed 5 years ago

andyli commented 5 years ago
import tink.CoreApi;

@await class Test {
    @await static function main() {
        try {
            @await Surprise.async(function(resolve){
                resolve(Failure("my fail msg"));
            });
        } catch(err:Dynamic) {
            trace("err: " + err);
        }
    }
}

It traces err: null, but I expect it to be err: my fail msg. I noticed that it works as expected if I change the main() meta from @await to @async.