See the discussion on #2174. An uncaught C++ error on main causes an error like:
```
TypeError: Cannot create property 'pyodide_fatal_error' on number '28811048'
```
With this the same error looks like:
```
Pyodide has suffered a fatal error. Please report this to the Pyodide maintainers.
The cause of the fatal error was:
CppException: Unable to cast Python instance to C++ type (compile in debug mode for details)
```
Support for C++ exceptions in packages. See the discussion on #2174. An uncaught C++ error on main causes an error like:
```
TypeError: Cannot create property 'pyodide_fatal_error' on number '28811048'
```
With this the same error looks like:
```
Pyodide has suffered a fatal error. Please report this to the Pyodide maintainers.
The cause of the fatal error was:
CppException: Unable to cast Python instance to C++ type (compile in debug mode for details)
```
package:
  name: libyaml
  version: 0.2.1

source:
  url: https://github.com/yaml/libyaml/archive/0.2.1.zip
  sha256: 56070c9d4bf244a8dcc68e04613e5bbce5c8411ed97cdccc1f4b5fb46aebe5a8

build:
  library: true
  script: |
    CFLAGS="-fPIC" emcmake cmake -DCMAKE_INSTALL_PREFIX=.. .
    emmake make -j ${PYODIDE_JOBS:-3}
    ln -s libyaml-0.2.1/libyaml_static.a ../libyaml.a
    ln -s libyaml-0.2.1/include ..

package:
  name: libyaml
  version: 0.2.1

source:
  url: https://github.com/yaml/libyaml/archive/0.2.1.zip
  sha256: 56070c9d4bf244a8dcc68e04613e5bbce5c8411ed97cdccc1f4b5fb46aebe5a8

build:
  library: true
  script: |
    CFLAGS="-fPIC" emcmake cmake -DCMAKE_INSTALL_PREFIX=.. .
    emmake make -j ${PYODIDE_JOBS:-3}
    ln -s libyaml-0.2.1/libyaml_static.a ../libyaml.a
    ln -s libyaml-0.2.1/include ..
