diff --git a/telebot/__init__.py b/telebot/__init__.py index 1332208..026d32e 100644 --- a/telebot/__init__.py +++ b/telebot/__init__.py @@ -5951,7 +5951,9 @@ class TeleBot: handler_error = e if self.exception_handler: self.exception_handler.handle(e) - else: logging.error(str(e)) + else: + logging.error(str(e)) + logger.debug("Exception traceback:\n%s", traceback.format_exc()) if middlewares: for middleware in middlewares: diff --git a/telebot/async_telebot.py b/telebot/async_telebot.py index 4397def..68e1768 100644 --- a/telebot/async_telebot.py +++ b/telebot/async_telebot.py @@ -416,6 +416,7 @@ class AsyncTeleBot: self.exception_handler.handle(e) else: logger.error(str(e)) + logger.debug("Exception traceback:\n%s", traceback.format_exc()) if middlewares: for middleware in middlewares: