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)
```
from pyodide_build.testing import run_in_pyodide


@run_in_pyodide(standalone=True, packages=["networkx"])
def test_networkx_basicgraph():
    import networkx as nx

    G = nx.Graph()
    G.add_nodes_from([1, 2, 3])
    G.add_edges_from([(1, 2), (1, 3)])

    assert G.number_of_nodes() == 3
    assert G.number_of_edges() == 2

from pyodide_build.testing import run_in_pyodide


@run_in_pyodide(standalone=True, packages=["networkx"])
def test_networkx_basicgraph():
    import networkx as nx

    G = nx.Graph()
    G.add_nodes_from([1, 2, 3])
    G.add_edges_from([(1, 2), (1, 3)])

    assert G.number_of_nodes() == 3
    assert G.number_of_edges() == 2
