Skip to content

Commit

Permalink
Print traceback on rule monitoring exception
Browse files Browse the repository at this point in the history
  • Loading branch information
TimJentzsch committed Aug 24, 2022
1 parent 6f97e92 commit fa822c0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion bubbles/tl_commands.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import inspect
import logging
import sys
import traceback
from datetime import datetime, timedelta

# from bubbles.commands.periodic.activity_checkin import (
Expand Down Expand Up @@ -95,7 +96,9 @@ def job(self):
rule_monitoring_callback()
except Exception as e:
# Catch all errors to make sure the bot doesn't crash
logging.error(f"Failed to check for rule changes: {e}")
# See <https://stackoverflow.com/a/62952274>
tb_str = ''.join(traceback.format_exception(None, e, e.__traceback__))
logging.error(f"Failed to check for rule changes: {e}\n{tb_str}")

class Meta:
start_interval = timedelta(seconds=0) # start now
Expand Down

0 comments on commit fa822c0

Please sign in to comment.