From 71256bdcb1790248f58b473d43c1a3b502f2cbc6 Mon Sep 17 00:00:00 2001 From: Jordi Mas Date: Thu, 10 Oct 2024 10:19:54 +0200 Subject: [PATCH] More details when an exception occurs --- src/whisper_ctranslate2/whisper_ctranslate2.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/whisper_ctranslate2/whisper_ctranslate2.py b/src/whisper_ctranslate2/whisper_ctranslate2.py index 02ba967..47e7c5f 100644 --- a/src/whisper_ctranslate2/whisper_ctranslate2.py +++ b/src/whisper_ctranslate2/whisper_ctranslate2.py @@ -9,6 +9,7 @@ import sys import datetime from .commandline import CommandLine +import traceback def get_diarization(audio, diarize_model, verbose): @@ -255,8 +256,12 @@ def main(): writer(result, audio_path, writer_args) except Exception as e: + error_details = traceback.format_exc() sys.stderr.write( - f"Error: unable to process file: {audio_path} with exception '{e}'\n" + f"Error: Unable to process file: {audio_path}\n" + f"Exception Type: {type(e).__name__}\n" + f"Exception Message: {e}\n" + f"Traceback:\n{error_details}\n" ) continue