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(