File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,12 @@ class Session:
5353 PING_INTERVAL = 5
5454 STORED_MSG_IDS_MAX_SIZE = 1000 * 2
5555
56+ TRANSPORT_ERRORS = {
57+ 404 : "auth key not found" ,
58+ 429 : "transport flood" ,
59+ 444 : "invalid DC"
60+ }
61+
5662 def __init__ (
5763 self ,
5864 client : "pyrogram.Client" ,
@@ -292,7 +298,12 @@ async def recv_worker(self):
292298
293299 if packet is None or len (packet ) == 4 :
294300 if packet :
295- log .warning ('Server sent "%s"' , Int .read (BytesIO (packet )))
301+ error_code = - Int .read (BytesIO (packet ))
302+
303+ log .warning (
304+ "Server sent transport error: %s (%s)" ,
305+ error_code , Session .TRANSPORT_ERRORS .get (error_code , "unknown error" )
306+ )
296307
297308 if self .is_started .is_set ():
298309 self .loop .create_task (self .restart ())
You can’t perform that action at this time.
0 commit comments