You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now, from what I understand, there is no way to wake up the C++ side with an error instead of a successful value. This makes errors in Asyncified functions behave differently than in regular imports in that, upon an async error, the C++ code can never be resumed, and such error has no chance of getting handled, and instead only ends up being printed to the Console.
This is not very important for wakeUp based handler, but in promises rejections are fairly common, and would be good to propagate those somehow back to C++.
I'd imagine following Promise's design here might be easy enough; basically, they have a resolve and reject callbacks, and are guaranteed that whatever is called first, wins, and no further resolution/rejection occurs.
As far as I can tell, wakeUp is a direct analogy for the resolve callback, so I'd imagine we could simply extend API to accept a reject callback as well, store it on the state, and on C++ side it would call throw instead of continuing execution.
The text was updated successfully, but these errors were encountered:
This issue has been automatically marked as stale because there has been no activity in the past year. It will be closed automatically if no further activity occurs in the next 30 days. Feel free to re-open at any time if this issue is still relevant.
Right now, from what I understand, there is no way to wake up the C++ side with an error instead of a successful value. This makes errors in Asyncified functions behave differently than in regular imports in that, upon an async error, the C++ code can never be resumed, and such error has no chance of getting handled, and instead only ends up being printed to the Console.
This is not very important for wakeUp based handler, but in promises rejections are fairly common, and would be good to propagate those somehow back to C++.
I'd imagine following Promise's design here might be easy enough; basically, they have a
resolve
andreject
callbacks, and are guaranteed that whatever is called first, wins, and no further resolution/rejection occurs.As far as I can tell,
wakeUp
is a direct analogy for theresolve
callback, so I'd imagine we could simply extend API to accept areject
callback as well, store it on the state, and on C++ side it would callthrow
instead of continuing execution.The text was updated successfully, but these errors were encountered: