Show tracebacks for bot exceptions

This commit is contained in:
Luke Murphy 2021-01-31 21:33:54 +01:00
parent 772a3e46a5
commit f275756451
No known key found for this signature in database
GPG Key ID: 5E2EF5A63E3718CC
1 changed files with 4 additions and 1 deletions

View File

@ -13,6 +13,7 @@ from os import environ
from os.path import exists
from pathlib import Path
from sys import exit, stdout
from traceback import print_exc
from humanize import naturaldelta
from slixmpp import ClientXMPP
@ -545,7 +546,8 @@ class Bot(ClientXMPP):
try:
self.direct(message)
except Exception as exception:
self.log.error(f"Bot.direct threw exception {exception}")
self.log.error(f"Bot.direct threw exception: {exception}")
print_exc(file=stdout)
if self.storage == "file":
self.db._dumps()
@ -628,6 +630,7 @@ class Bot(ClientXMPP):
self.group(message)
except Exception as exception:
self.log.error(f"Bot.group threw exception: {exception}")
print_exc(file=stdout)
if self.storage == "file":
self.db._dumps()