Skip to content

Commit aae27bb

Browse files
authored
Show traceback before raising ExecutionError (#531)
1 parent 3d6a5d1 commit aae27bb

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

myst_nb/core/execute/cache.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,12 @@ def start_client(self):
8080
# handle success / failure cases
8181
# TODO do in try/except to be careful (in case of database write errors?
8282
if result.err is not None:
83-
if self.nb_config.execution_raise_on_error:
84-
raise ExecutionError(str(self.path)) from result.err
8583
msg = f"Executing notebook failed: {result.err.__class__.__name__}"
8684
if self.nb_config.execution_show_tb:
8785
msg += f"\n{result.exc_string}"
8886
self.logger.warning(msg, subtype="exec")
87+
if self.nb_config.execution_raise_on_error:
88+
raise ExecutionError(str(self.path)) from result.err
8989
NbProjectRecord.set_traceback(stage_record.uri, result.exc_string, cache.db)
9090
else:
9191
self.logger.info(f"Executed notebook in {result.time:.2f} seconds")

0 commit comments

Comments
 (0)