From a8a9a1ac1f51e7f3c7fb3328c414a03f94916eb0 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Sun, 27 Dec 2020 21:08:01 +0100 Subject: [PATCH] Also print the exception type when logging query issues Use "repr(e)" instead of "e" alone (i.e "str(e)") because sometimes builtin exceptions have no message (for example: OSError, TimeoutError) --- pyrogram/session/session.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyrogram/session/session.py b/pyrogram/session/session.py index 2fa8c809..58d1e457 100644 --- a/pyrogram/session/session.py +++ b/pyrogram/session/session.py @@ -433,7 +433,7 @@ class Session: raise e from None (log.warning if retries < 2 else log.info)( - f'[{Session.MAX_RETRIES - retries + 1}] Retrying "{query}" due to {e}') + f'[{Session.MAX_RETRIES - retries + 1}] Retrying "{query}" due to {repr(e)}') await asyncio.sleep(0.5)