Skip to content

Stop execution on notebook errors

Thomas Kluyver requested to merge on-error-give-up into master

Description

See calibration/planning#34. Trying to carry on executing a notebook after an uncaught exception rarely works, because the later code often depends on things which didn't happen (variables not defined, files not written, etc.). This stops notebook execution on uncaught errors, as is the norm for Python (and, I think, most languages with exceptions). This should make for clearer output when things do go wrong (because there aren't a load of meaningless extra errors after the real problem).

Slurm still shouldn't treat the jobs as failing, because bash does essentially the same thing by default: unless you use set -e, it will ignore failing commands and carry on to the next one. So reports should still be generated and files moved as expected. I plan to address that in a later step.

How Has This Been Tested?

Running xfel-calibrate at the command line. Output is in /gpfs/exfel/data/scratch/kluyvert/agipd-calib-900201-203-errstop.

Types of changes

  • Bug fix
  • Breaking change (potentially, if there are cases which rely on subsequent cells executing after an error)

Checklist:

  • My code follows the code style of this project.

Reviewers

@schmidtp @hammerd

Merge request reports