emscripten-core / emscripten-core/emscripten

Public API to get `WebAssembly.Exception` `val` from `exception_ptr`

Open
#25,963 1 comment 0 reactions 1 assignee Claimed by @brendandahl View on GitHub
embind
Dominant language
C++
Stars
27.6k
Forks
3.6k
Avg merge
1d 1h
Merged PRs (30d)
105

Description

It would be useful to have a public (stable) API to convert a `std::exception_ptr` (or at least the current exception) to an `emscripten::val` for a `WebAssembly.Exception` (or `Error` derivative for Emscripten EH). For example, to invoke a JS on-error callback when an unexpected C++ exception occurs.

Currently there is `val::take_ownership(emscripten::internal::_emval_from_current_cxa_exception())`, but this is an internal API and is marked as C++20 only because it's used for coroutines.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.