mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2025-12-29 12:04:51 +00:00
Raise exception if auth key not found
Signed-off-by: wulan17 <wulan17@nusantararom.org>
This commit is contained in:
parent
4795bdbd5b
commit
58f0031ead
1 changed files with 6 additions and 0 deletions
|
|
@ -309,6 +309,12 @@ class Session:
|
||||||
if packet:
|
if packet:
|
||||||
error_code = -Int.read(BytesIO(packet))
|
error_code = -Int.read(BytesIO(packet))
|
||||||
|
|
||||||
|
if error_code == 404:
|
||||||
|
raise Exception(
|
||||||
|
"Auth key not found in the system. You must delete your session file"
|
||||||
|
"and log in again with your phone number or bot token"
|
||||||
|
)
|
||||||
|
|
||||||
log.warning(
|
log.warning(
|
||||||
"Server sent transport error: %s (%s)",
|
"Server sent transport error: %s (%s)",
|
||||||
error_code, Session.TRANSPORT_ERRORS.get(error_code, "unknown error")
|
error_code, Session.TRANSPORT_ERRORS.get(error_code, "unknown error")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue