diff --git a/src/python/jw/pkg/lib/App.py b/src/python/jw/pkg/lib/App.py index 123aad2f..01e3bb3c 100644 --- a/src/python/jw/pkg/lib/App.py +++ b/src/python/jw/pkg/lib/App.py @@ -300,9 +300,17 @@ class App: # export pr.enable() try: - ret = await self._run(self.__args) - if isinstance(ret, int) and ret >= 0 and ret <= 0xFF: - exit_status = ret + result = await self._run(self.__args) + if isinstance(result, int): + if 0 <= result <= 0xFF: + exit_status = result + else: + log( + WARNING, + f'Command returned invalid exit status {result}, ' + 'using 1 instead', + ) + exit_status = 1 except Exception as e: log_m(ERR, f'Failed: {repr(e) if self.__back_trace else str(e)}') exit_status = 1