jupyter-xeus / xeus-python

Jupyter kernel for the Python programming language
BSD 3-Clause "New" or "Revised" License
432 stars 73 forks source link

catch cpp exceptions #610

Closed DerThorsten closed 8 months ago

DerThorsten commented 8 months ago

I noticed that C++ exceptions thrown from a Python package built with pybind11 are not handled properly. In the jupyterlite case, they only appear in the browser console but not in the notebook as expected.

This simple try/catch block fixes the issue. I also removed the unused py::object ipython_res