mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-29 13:27:47 +00:00
Merge branch 'master' into new-api
This commit is contained in:
commit
398858acc1
@ -54,13 +54,13 @@ class Error(Exception):
|
|||||||
code = rpc_error.error_code
|
code = rpc_error.error_code
|
||||||
|
|
||||||
if code not in exceptions:
|
if code not in exceptions:
|
||||||
raise UnknownError(rpc_error, query_type)
|
raise UnknownError(x=rpc_error, query_type=query_type)
|
||||||
|
|
||||||
message = rpc_error.error_message
|
message = rpc_error.error_message
|
||||||
id = re.sub(r"_\d+", "_X", message)
|
id = re.sub(r"_\d+", "_X", message)
|
||||||
|
|
||||||
if id not in exceptions[code]:
|
if id not in exceptions[code]:
|
||||||
raise UnknownError(rpc_error, query_type)
|
raise UnknownError(x=rpc_error, query_type=query_type)
|
||||||
|
|
||||||
x = re.search(r"_(\d+)", message)
|
x = re.search(r"_(\d+)", message)
|
||||||
x = x.group(1) if x is not None else x
|
x = x.group(1) if x is not None else x
|
||||||
@ -68,7 +68,7 @@ class Error(Exception):
|
|||||||
raise getattr(
|
raise getattr(
|
||||||
import_module("pyrogram.api.errors"),
|
import_module("pyrogram.api.errors"),
|
||||||
exceptions[code][id]
|
exceptions[code][id]
|
||||||
)(x)
|
)(x=x)
|
||||||
|
|
||||||
|
|
||||||
class UnknownError(Error):
|
class UnknownError(Error):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user