diff --git a/edmond/bot.py b/edmond/bot.py index 494fc17..9255b54 100644 --- a/edmond/bot.py +++ b/edmond/bot.py @@ -3,6 +3,8 @@ import json import os import time import signal +import sys +import traceback from pathlib import Path from typing import Any, Iterable, Optional @@ -123,8 +125,11 @@ class Bot(irc.client.SimpleIRCClient, Logger): self.start() except KeyboardInterrupt: self.log_i("Caught keyboard interrupt.") - except Exception as exc: # Yes, I know, who are you going to call? + except Exception as exc: self.log_c(f"Caught unhandled exception: {exc}") + _, _, exc_traceback = sys.exc_info() + for line in traceback.format_tb(exc_traceback): + self.log_d(line.rstrip()) finally: self.cleanup()