Show more meaningful errors for wrapped queries

This commit is contained in:
Dan 2020-02-01 15:19:05 +01:00
parent 0684a4ba93
commit 2bf6357bad

View File

@ -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(