Skip to content

Commit 59b43af

Browse files
committed
Fix RPCError not setting the x attribute
1 parent 46bf382 commit 59b43af

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

pyrogram/errors/rpc_error.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ def __init__(self, x: int or RawRPCError, rpc_name: str, is_unknown: bool):
4040
'caused by "{}"'.format(rpc_name)
4141
))
4242

43+
try:
44+
self.x = int(x)
45+
except (ValueError, TypeError):
46+
self.x = x
47+
4348
if is_unknown:
4449
with open("unknown_errors.txt", "a", encoding="utf-8") as f:
4550
f.write("{}\t{}\t{}\n".format(datetime.now(), x, rpc_name))

0 commit comments

Comments
 (0)