Description
I am using the Pyodide project with Emscripten to compile a C++ Python library for use in the browser. I have found that exceptions are working sometimes, but other times they are not caught correctly and filter back to Python instead. If the throw
and catch
are in the same function, it seems to work correctly. If they are in different functions, it is not caught. Because of the use of Boost and CMake the module has to be built separately, so it is possible. I haven't found the magic combination of compiler flags to make it work. Pyodide is using side modules with dynamic loading. I looked through the generated wasm text code and the exception checks were being generated.
The original issue with more details can be found here:
Test case:
https://gist.github.com/johnwason/422b0bd9787088db3d12b422a6a835ff