fix handling of SystemExit
This commit is contained in:
parent
28c796a234
commit
6b144150c7
@ -52,13 +52,15 @@ def main(sysargv: List[str] = None) -> None:
|
|||||||
worker = Worker(args)
|
worker = Worker(args)
|
||||||
worker.run()
|
worker.run()
|
||||||
|
|
||||||
|
except SystemExit as e:
|
||||||
|
return_code = e
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
logger.info('SIGINT received, aborting ...')
|
logger.info('SIGINT received, aborting ...')
|
||||||
return_code = 0
|
return_code = 0
|
||||||
except OperationalException as e:
|
except OperationalException as e:
|
||||||
logger.error(str(e))
|
logger.error(str(e))
|
||||||
return_code = 2
|
return_code = 2
|
||||||
except BaseException:
|
except Exception:
|
||||||
logger.exception('Fatal exception!')
|
logger.exception('Fatal exception!')
|
||||||
finally:
|
finally:
|
||||||
if worker:
|
if worker:
|
||||||
|
Loading…
Reference in New Issue
Block a user