if error doesn't have a message set, print a stack trace

This commit is contained in:
Jörg Thalheim
2024-09-25 18:40:43 +02:00
parent 84383a4a48
commit 1e11cd79c4

View File

@@ -421,7 +421,9 @@ def main() -> None:
log.error(msg) # noqa: TRY400
sys.exit(1)
log.fatal(e.msg)
if not e.msg: # should not be empty, print stack trace
raise
msg = e.msg
if e.description:
print(f"========> {e.description}", file=sys.stderr)
sys.exit(1)