From afb2c2d5b297c5aa28bcced0e3f90e207d799c2a Mon Sep 17 00:00:00 2001 From: historia Date: Fri, 28 Aug 2026 13:51:01 -0400 Subject: fix: remove backtrace from console output when using incorrect/incomplete cli flags --- audiobook.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'audiobook.py') 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 -- cgit v1.2.3