mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2025-12-29 12:04:51 +00:00
Better error message in case of empty data in buffer
This commit is contained in:
parent
c13230cb81
commit
e4f99df07c
1 changed files with 3 additions and 0 deletions
|
|
@ -63,6 +63,9 @@ def unpack(b: BytesIO, session_id: bytes, auth_key: bytes, auth_key_id: bytes) -
|
|||
try:
|
||||
message = Message.read(data)
|
||||
except KeyError as e:
|
||||
if e.args[0] == 0:
|
||||
raise ConnectionError(f"Received empty data. Check your internet connection.")
|
||||
|
||||
left = data.read().hex()
|
||||
|
||||
left = [left[i:i + 64] for i in range(0, len(left), 64)]
|
||||
|
|
|
|||
Loading…
Reference in a new issue