Skip to content

Commit

Permalink
catch errors globally (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
eikowagenknecht authored Mar 30, 2022
1 parent 2edc27e commit 1946423
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lootscraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 1946423

Please sign in to comment.