Skip to content

Commit

Permalink
fix: Exception was not reprotyed properly in async calls on WASM
Browse files Browse the repository at this point in the history
  • Loading branch information
dr1rrb committed Aug 26, 2021
1 parent 36c9eaa commit f93e40d
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/Uno.UI/ts/Interop/AsyncInteropHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,22 @@
}
})
.catch(err => {
AsyncInteropHelper.dispatchErrorMethod(handle, err);
if (typeof err == "string") {
AsyncInteropHelper.dispatchErrorMethod(handle, err);
} else if (err.message && err.stack) {
AsyncInteropHelper.dispatchErrorMethod(handle, err.message + "\n" + err.stack);
} else {
AsyncInteropHelper.dispatchErrorMethod(handle, "" + err);
}
});
} catch (err) {
AsyncInteropHelper.dispatchErrorMethod(handle, err);
if (typeof err == "string") {
AsyncInteropHelper.dispatchErrorMethod(handle, err);
} else if (err.message && err.stack) {
AsyncInteropHelper.dispatchErrorMethod(handle, err.message + "\n" + err.stack);
} else {
AsyncInteropHelper.dispatchErrorMethod(handle, "" + err);
}
}
}
}
Expand Down

0 comments on commit f93e40d

Please sign in to comment.