mirror of
https://github.com/m-labs/artiq.git
synced 2024-12-27 04:08:27 +08:00
afws_client: report error on JSON data length mismatch
This commit is contained in:
parent
e627aaeda0
commit
2241a32c9a
@ -165,6 +165,8 @@ class Client:
|
||||
return reply[0], None
|
||||
length = int(reply[1])
|
||||
json_bytes = await self.reader.read(length)
|
||||
if length != len(json_bytes):
|
||||
raise ValueError(f"Received data length ({len(json_bytes)}) doesn't match expected length ({length})")
|
||||
return "OK", json_bytes
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user