nteract / papermill

📚 Parameterize, execute, and analyze notebooks
http://papermill.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
5.97k stars 429 forks source link

Add the output notebook object to PapermillExecutionError #795

Open joeenzminger opened 6 months ago

joeenzminger commented 6 months ago

🚀 Feature

Add the output notebook object to PapermillExecutionError

Motivation

When running the notebook using python, the only current way to access the output notebook on an exception is by writing the notebook to an I/O handler. If all we need to do in the application executing the notebook is to inspect the notebook (for instance for looking for data attached with a library like scrapbook), we have to write the notebook to the I/O handler, then reconstitute it after handling the exception. This is slow(er), and a bit of a challenge when all we want is the notebook object AFTER an exception.