mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-26 03:13:45 +03:00
Rename rpc_n_errors dictionary to rpc_errors_n_all
This commit is contained in:
parent
20956b23d1
commit
459e988ff5
|
@ -18,10 +18,10 @@ from .rpc_errors_420 import *
|
||||||
|
|
||||||
def rpc_message_to_error(code, message):
|
def rpc_message_to_error(code, message):
|
||||||
errors = {
|
errors = {
|
||||||
303: rpc_303_errors,
|
303: rpc_errors_303_all,
|
||||||
400: rpc_400_errors,
|
400: rpc_errors_400_all,
|
||||||
401: rpc_401_errors,
|
401: rpc_errors_401_all,
|
||||||
420: rpc_420_errors
|
420: rpc_errors_420_all
|
||||||
}.get(code, None)
|
}.get(code, None)
|
||||||
|
|
||||||
if errors is not None:
|
if errors is not None:
|
||||||
|
|
|
@ -43,7 +43,7 @@ class UserMigrateError(InvalidDCError):
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
rpc_303_errors = {
|
rpc_errors_303_all = {
|
||||||
'FILE_MIGRATE_(\d+)': FileMigrateError,
|
'FILE_MIGRATE_(\d+)': FileMigrateError,
|
||||||
'PHONE_MIGRATE_(\d+)': PhoneMigrateError,
|
'PHONE_MIGRATE_(\d+)': PhoneMigrateError,
|
||||||
'NETWORK_MIGRATE_(\d+)': NetworkMigrateError,
|
'NETWORK_MIGRATE_(\d+)': NetworkMigrateError,
|
||||||
|
|
|
@ -321,7 +321,7 @@ class UserIdInvalidError(BadRequestError):
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
rpc_400_errors = {
|
rpc_errors_400_all = {
|
||||||
'API_ID_INVALID': ApiIdInvalidError,
|
'API_ID_INVALID': ApiIdInvalidError,
|
||||||
'BOT_METHOD_INVALID': BotMethodInvalidError,
|
'BOT_METHOD_INVALID': BotMethodInvalidError,
|
||||||
'CHANNEL_INVALID': ChannelInvalidError,
|
'CHANNEL_INVALID': ChannelInvalidError,
|
||||||
|
|
|
@ -84,7 +84,7 @@ class UserDeactivatedError(UnauthorizedError):
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
rpc_401_errors = {
|
rpc_errors_401_all = {
|
||||||
'ACTIVE_USER_REQUIRED': ActiveUserRequiredError,
|
'ACTIVE_USER_REQUIRED': ActiveUserRequiredError,
|
||||||
'AUTH_KEY_INVALID': AuthKeyInvalidError,
|
'AUTH_KEY_INVALID': AuthKeyInvalidError,
|
||||||
'AUTH_KEY_PERM_EMPTY': AuthKeyPermEmptyError,
|
'AUTH_KEY_PERM_EMPTY': AuthKeyPermEmptyError,
|
||||||
|
|
|
@ -11,6 +11,6 @@ class FloodWaitError(FloodError):
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
rpc_420_errors = {
|
rpc_errors_420_all = {
|
||||||
'FLOOD_WAIT_(\d+)': FloodWaitError
|
'FLOOD_WAIT_(\d+)': FloodWaitError
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user