Skip to content

Commit

Permalink
Fix propagation of exception from async void function by getting the …
Browse files Browse the repository at this point in the history
…result from future so the exception can be thrown, catched and translated
  • Loading branch information
arekmula committed Feb 19, 2024
1 parent 5e37ac6 commit 4061704
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions support-lib/wasm/Future_wasm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ class FutureAdaptor
void doResolve() {
try {
if constexpr (std::is_void_v<typename RESULT::CppType>) {
_future->get();
_resolveFunc(em::val::undefined());
} else {
_resolveFunc(RESULT::Boxed::fromCpp(_future->get()));
Expand Down

0 comments on commit 4061704

Please sign in to comment.