Преглед изворни кода

fix: represent exception as bytes

Denis Mazur пре 4 година
родитељ
комит
c92e633f84
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      hivemind/p2p/p2p_daemon_bindings/control.py

+ 1 - 1
hivemind/p2p/p2p_daemon_bindings/control.py

@@ -137,7 +137,7 @@ class ControlClient:
             response_payload: bytes = await self.unary_handlers[request.proto](request.data, remote_id)
             response = p2pd_pb.CallUnaryResponse(callId=request.callId, result=response_payload)
         except Exception as e:
-            response = p2pd_pb.CallUnaryResponse(callId=request.callId, error=repr(e))
+            response = p2pd_pb.CallUnaryResponse(callId=request.callId, error=repr(e).encode())
 
         await self.pending_messages.put(
             p2pd_pb.Request(type=p2pd_pb.Request.SEND_RESPONSE_TO_REMOTE, sendResponseToRemote=response)