fix: server correctly handles non-JSON payloads
This commit addresses the server not handling non-JSON payloads correctly. Fixes #2
This commit is contained in:
parent
3c72572ba4
commit
d7151ca5b0
@ -83,6 +83,8 @@ class Server:
|
|||||||
else:
|
else:
|
||||||
command = "nop"
|
command = "nop"
|
||||||
conn.send(json.dumps({"command": command}).encode())
|
conn.send(json.dumps({"command": command}).encode())
|
||||||
|
except json.decoder.JSONDecodeError:
|
||||||
|
logger.error(f"Invalid JSON received from {addr}")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"Error handling agent {agent_id}: {e}")
|
logger.error(f"Error handling agent {agent_id}: {e}")
|
||||||
finally:
|
finally:
|
||||||
|
Loading…
Reference in New Issue
Block a user