Add debug logging to backend SocketServer message processing

parent fb33730a
......@@ -153,6 +153,7 @@ class SocketServer:
messages = decoded.split('\n')
for msg_str in messages:
if msg_str.strip():
print(f"DEBUG: SocketServer processing message: {repr(msg_str)}")
try:
msg_data = json.loads(msg_str)
message = Message(
......@@ -160,6 +161,7 @@ class SocketServer:
msg_id=msg_data['msg_id'],
data=msg_data['data']
)
print(f"DEBUG: SocketServer parsed message: {message}")
response = self.message_handler(message)
if response:
resp_data = json.dumps({
......@@ -168,7 +170,8 @@ class SocketServer:
'data': response.data
}).encode('utf-8')
client_sock.sendall(resp_data + b'\n')
except json.JSONDecodeError:
except json.JSONDecodeError as e:
print(f"DEBUG: SocketServer JSON decode error: {e}")
pass
except:
pass
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment