There was an error while loading. Please reload this page.
1 parent 46bf382 commit 59b43afCopy full SHA for 59b43af
1 file changed
pyrogram/errors/rpc_error.py
@@ -40,6 +40,11 @@ def __init__(self, x: int or RawRPCError, rpc_name: str, is_unknown: bool):
40
'caused by "{}"'.format(rpc_name)
41
))
42
43
+ try:
44
+ self.x = int(x)
45
+ except (ValueError, TypeError):
46
+ self.x = x
47
+
48
if is_unknown:
49
with open("unknown_errors.txt", "a", encoding="utf-8") as f:
50
f.write("{}\t{}\t{}\n".format(datetime.now(), x, rpc_name))
0 commit comments