From c6d30ffceb679e71c9de208f42f86e66fba3c924 Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Wed, 25 Oct 2017 13:04:12 +0200 Subject: [PATCH] Fix exception when logging exceptions --- telethon/update_state.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/telethon/update_state.py b/telethon/update_state.py index 8dd2ffad..9410125e 100644 --- a/telethon/update_state.py +++ b/telethon/update_state.py @@ -119,10 +119,10 @@ class UpdateState: handler(update) except StopIteration: break - except Exception as e: + except: # We don't want to crash a worker thread due to any reason - self._logger.debug( - '[ERROR] Unhandled exception on worker {}'.format(wid), e + self._logger.exception( + '[ERROR] Unhandled exception on worker {}'.format(wid) ) def process(self, update):