Better error message in case of empty data in buffer
This commit is contained in:
parent
c13230cb81
commit
e4f99df07c
@ -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 New Issue
Block a user