mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-26 11:23:46 +03:00
Except RpcMcgetFailError as call fail and sleep on server errors
This one in particular may happen when iterating over messages, perhaps more likely to happen if the group was created in a different data center. A small sleep of a few seconds also greatly increases the chances of the error going away.
This commit is contained in:
parent
2e544270cd
commit
d1c755809d
|
@ -233,7 +233,7 @@ class AuthMethods(MessageParseMethods, UserMethods):
|
|||
|
||||
phone_hash = phone_hash or self._phone_code_hash.get(phone, None)
|
||||
if not phone_hash:
|
||||
raise ValueError('You also need to provide a phone_hash.')
|
||||
raise ValueError('You also need to provide a phone_code_hash.')
|
||||
|
||||
return phone, phone_hash
|
||||
|
||||
|
|
|
@ -60,10 +60,13 @@ class UserMethods(TelegramBaseClient):
|
|||
result = await future
|
||||
self.session.process_entities(result)
|
||||
return result
|
||||
except (errors.ServerError, errors.RpcCallFailError) as e:
|
||||
except (errors.ServerError, errors.RpcCallFailError,
|
||||
errors.RpcMcgetFailError) as e:
|
||||
self._log[__name__].warning(
|
||||
'Telegram is having internal issues %s: %s',
|
||||
e.__class__.__name__, e)
|
||||
|
||||
await asyncio.sleep(2)
|
||||
except (errors.FloodWaitError, errors.FloodTestPhoneWaitError) as e:
|
||||
if utils.is_list_like(request):
|
||||
request = request[request_index]
|
||||
|
|
Loading…
Reference in New Issue
Block a user