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)
```
# setup: import numpy as np ; N = 100000 ; a = np.random.random(N); b = 0.1; c =1.1  # noqa
# run: log_likelihood(a, b, c)
# from: http://arogozhnikov.github.io/2015/09/08/SpeedBenchmarks.html
import numpy

# pythran export log_likelihood(float64[], float64, float64)


def log_likelihood(data, mean, sigma):
    s = (data - mean) ** 2 / (2 * (sigma**2))
    pdfs = numpy.exp(-s)
    pdfs /= numpy.sqrt(2 * numpy.pi) * sigma
    return numpy.log(pdfs).sum()

# setup: import numpy as np ; N = 100000 ; a = np.random.random(N); b = 0.1; c =1.1  # noqa
# run: log_likelihood(a, b, c)
# from: http://arogozhnikov.github.io/2015/09/08/SpeedBenchmarks.html
import numpy

# pythran export log_likelihood(float64[], float64, float64)


def log_likelihood(data, mean, sigma):
    s = (data - mean) ** 2 / (2 * (sigma**2))
    pdfs = numpy.exp(-s)
    pdfs /= numpy.sqrt(2 * numpy.pi) * sigma
    return numpy.log(pdfs).sum()
