Nbconvert: ExecutePreprocessor: stop at error but save notebook (and stack trace)

Created on 13 Jul 2017  路  4Comments  路  Source: jupyter/nbconvert

Hi,

I am trying to use nbconvert to run notebooks from the commandline. I would like to stop if cell execution fails anywhere (as it is the default), but in this case I see only the raw exception at the command line. Since the notebook is not saved in this case, I have no access to the full stack trace of the exception.

is it possible to either

  • display the full stack trace in the console or
  • save the notebook after the first error? #120 suggests to me that that should be the default. But for me the notebook is never saved unless I specify allow_errors, in which case all cells are executed

Thankyou for your help!

Execute

Most helpful comment

@berleon have you tried to get your fix merged we would be very interested in this feature as well

All 4 comments

Yep, we should include the traceback in the error message as well.

Hi there,

I'm running into a similar problem. When executing notebook in a Jenkins pipeline, it would be great @matthias-k second suggestion would be possible.

Then I could execute the notebook via Jenkins and in case of a failure for example attach the HTML output showing the notebook execution up to the error as an attachment to an email.

Based on my tests it seems that with allow_error nbconvert does return no error code and without allow_error it does return an error code, but does not save the HTML output.

Many thanks for your help (and of course nbconvert!)

馃憤 for Kaggle. What's the status for this. Will the --save-on-error support be merged in?

@berleon have you tried to get your fix merged we would be very interested in this feature as well

Was this page helpful?
0 / 5 - 0 ratings