Update error handling and exiting

This commit is contained in:
Kumi 2023-09-06 08:16:47 +02:00
parent 22d2c06f60
commit c3633450bb
Signed by: kumi
GPG key ID: ECBCC9082395383F

View file

@ -172,7 +172,7 @@ class Tracker:
except KeyboardInterrupt:
logging.info("Keyboard interrupt, exiting")
sys.exit(0)
exit(0)
except Exception as e:
logging.exception(f"Unknown error in loop: {e}")
@ -200,9 +200,9 @@ class Tracker:
except sqlalchemy.exc.TimeoutError:
logging.warning("Database timeout while processing shipments")
except KeyboardInterrupt:
except (KeyboardInterrupt, asyncio.CancelledError):
logging.info("Keyboard interrupt, exiting")
sys.exit(0)
exit(0)
except Exception as e:
logging.exception(f"Unknown error in loop: {e}")