From 2bf6357badceba53151f0c57f37228f17c622922 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Sat, 1 Feb 2020 15:19:05 +0100 Subject: [PATCH] Show more meaningful errors for wrapped queries --- pyrogram/session/session.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyrogram/session/session.py b/pyrogram/session/session.py index 054de381..2306efc2 100644 --- a/pyrogram/session/session.py +++ b/pyrogram/session/session.py @@ -420,6 +420,9 @@ class Session: if result is None: raise TimeoutError elif isinstance(result, types.RpcError): + if isinstance(data, (functions.InvokeWithoutUpdates, functions.InvokeWithTakeout)): + data = data.query + RPCError.raise_it(result, type(data)) elif isinstance(result, types.BadMsgNotification): raise Exception(self.BAD_MSG_DESCRIPTION.get(