jupyterlite / pyodide-kernel

Python kernel for JupyterLite powered by Pyodide
https://jupyterlite-pyodide-kernel.readthedocs.io/en/latest/_static/
BSD 3-Clause "New" or "Revised" License
46 stars 25 forks source link

Feedback on kernel start crash #138

Open juntyr opened 1 month ago

juntyr commented 1 month ago

Problem

Sometimes when starting a fresh kernel, it fails to start, e.g. because there is a network error in fetching the packages that the Pyodide kernel fetches on startup. If the end user is not familiar with the dev tools console, there is often no indication as to what has happened and why the kernel is not up and running.

Proposed Solution

There should be a try catch around all kernel init code. If an exception is raised, something should happen, e.g. passing a stderr message to the frontend that tells the user that the kernel failed to start, instructs them to save the file and open it again to start a new kernel (since restarting a kernel doesn't always work given the unsolved race conditions), and includes the full error details after that.