fix handling of SystemExit

This commit is contained in:
hroff-1902 2019-05-30 20:38:04 +03:00
parent 28c796a234
commit 6b144150c7

View File

@ -52,13 +52,15 @@ def main(sysargv: List[str] = None) -> None:
worker = Worker(args)
worker.run()
except SystemExit as e:
return_code = e
except KeyboardInterrupt:
logger.info('SIGINT received, aborting ...')
return_code = 0
except OperationalException as e:
logger.error(str(e))
return_code = 2
except BaseException:
except Exception:
logger.exception('Fatal exception!')
finally:
if worker: