From 59b43af02e79b80b1f3831e8157f2e128d61d263 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Fri, 28 Jun 2019 20:43:06 +0200 Subject: [PATCH] Fix RPCError not setting the x attribute --- pyrogram/errors/rpc_error.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pyrogram/errors/rpc_error.py b/pyrogram/errors/rpc_error.py index fb3a717d..e0acdc21 100644 --- a/pyrogram/errors/rpc_error.py +++ b/pyrogram/errors/rpc_error.py @@ -40,6 +40,11 @@ class RPCError(Exception): 'caused by "{}"'.format(rpc_name) )) + try: + self.x = int(x) + except (ValueError, TypeError): + self.x = x + if is_unknown: with open("unknown_errors.txt", "a", encoding="utf-8") as f: f.write("{}\t{}\t{}\n".format(datetime.now(), x, rpc_name))