Skip to content

Commit

Permalink
feat: Allow exceptions in experiments to cause breakpoints in debug mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacob-Stevens-Haas committed Feb 29, 2024
1 parent 8995c6e commit ec7ae48
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion mitosis/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,10 +496,14 @@ def _run_in_notebook(
ep = ExecutePreprocessor(timeout=-1, kernel=kernel_name)
exception = None
metrics = None
if debug:
allowed = ()
else:
allowed = (nbclient.exceptions.CellExecutionError,)
try:
ep.preprocess(nb, {"metadata": {"path": trials_folder}})
metrics = nb["cells"][-1]["outputs"][0]["text"][:-1]
except nbclient.exceptions.CellExecutionError as exc:
except allowed as exc:
exception = exc
return nb, metrics, exception

Expand Down

0 comments on commit ec7ae48

Please sign in to comment.