From 19464237ee5e997a5707b1cd06addec6036ced3b Mon Sep 17 00:00:00 2001 From: Eiko Wagenknecht Date: Wed, 30 Mar 2022 11:31:29 +0200 Subject: [PATCH] catch errors globally (#30) --- lootscraper.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lootscraper.py b/lootscraper.py index 3e657b0..979be37 100644 --- a/lootscraper.py +++ b/lootscraper.py @@ -53,7 +53,12 @@ def main() -> None: run = 1 while not exit.is_set(): logging.info(f"Starting Run # {run}") - job() + + try: + job() + except Exception as e: + # Something unexpected occurred, log it and continue with the next run as usual + logging.exception(e) time_between_runs = int(Config.config()["common"]["WaitBetweenRuns"]) if time_between_runs == 0: