Skip to content

Commit

Permalink
fix traceback handling
Browse files Browse the repository at this point in the history
Signed-off-by: Panos Vagenas <[email protected]>
  • Loading branch information
vagenas committed Jun 10, 2024
1 parent dcbbf00 commit 07635e3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions nbrunner/nb_runner.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import glob
import os
import traceback
import uuid
from pathlib import Path
from typing import Optional, Set
Expand Down Expand Up @@ -56,9 +57,9 @@ def execute_notebook(self, run_id, notebook_path):
)
try:
out = ep.preprocess(nb, {"metadata": {"path": notebook_path.parent}})
except (CellExecutionError, CellTimeoutError) as e:
except (CellExecutionError, CellTimeoutError):
print(f"=> Error during {run_id}; check {output_filename} for details")
print(e.traceback)
print(traceback.print_exc())
out = None
finally:
with open(output_filename, mode="w", encoding="utf-8") as f:
Expand Down

0 comments on commit 07635e3

Please sign in to comment.