From 07635e36f4e352ab9b953fd308d17525e44d4eda Mon Sep 17 00:00:00 2001 From: Panos Vagenas <35837085+vagenas@users.noreply.github.com> Date: Mon, 10 Jun 2024 10:15:13 +0200 Subject: [PATCH] fix traceback handling Signed-off-by: Panos Vagenas <35837085+vagenas@users.noreply.github.com> --- nbrunner/nb_runner.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nbrunner/nb_runner.py b/nbrunner/nb_runner.py index b5f7503..fcf7983 100644 --- a/nbrunner/nb_runner.py +++ b/nbrunner/nb_runner.py @@ -1,5 +1,6 @@ import glob import os +import traceback import uuid from pathlib import Path from typing import Optional, Set @@ -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: