From 1b2ebab33abf03d8ebc847e5fc0d21beed01c497 Mon Sep 17 00:00:00 2001 From: Jan Lindemann Date: Mon, 13 Apr 2026 12:12:40 +0200 Subject: [PATCH] lib.App.__run(): Beautify error logging Without --backtrace, the outmost try-catch block logs exceptions plainly as their text. If it catches a key error, the exception text only consists of the key itself, which can be easily mistaken for a normal program output, so prefix it with a "Failed:". Signed-off-by: Jan Lindemann --- src/python/jw/pkg/lib/App.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/python/jw/pkg/lib/App.py b/src/python/jw/pkg/lib/App.py index 04463911..6cb95777 100644 --- a/src/python/jw/pkg/lib/App.py +++ b/src/python/jw/pkg/lib/App.py @@ -131,9 +131,8 @@ class App: # export ret = await self._run(self.__args) if isinstance(ret, int) and ret >= 0 and ret <= 0xFF: exit_status = ret - except Exception as e: - log(ERR, repr(e) if self.__back_trace else str(e)) + log(ERR, 'Failed: {}'.format(repr(e) if self.__back_trace else str(e))) exit_status = 1 if self.__back_trace: raise