aboutsummaryrefslogtreecommitdiff
path: root/audiobook.py
diff options
context:
space:
mode:
Diffstat (limited to 'audiobook.py')
-rwxr-xr-xaudiobook.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/audiobook.py b/audiobook.py
index 0d0f5d7..811ffdf 100755
--- a/audiobook.py
+++ b/audiobook.py
@@ -187,8 +187,14 @@ def convert(backend: str = None, voice: str = None, clone: str = None,
print("\n[WARNING] Shutdown requested by user")
return 130
except Exception as exc:
+ # Expected failures (bad flags, unreachable server, missing voice)
+ # raise RuntimeError/ValueError with an actionable message: show
+ # that once and keep the full traceback in the dated log file.
+ # Anything else is an actual crash, so also show the traceback.
+ logging_kit.log_traceback()
print(f"[FATAL] Fatal error: {exc}")
- traceback.print_exc()
+ if not isinstance(exc, (RuntimeError, ValueError)):
+ traceback.print_exc()
if progress is not None:
progress({"kind": "error", "message": str(exc)})
return 1