Browse Source

fix: represent exception as bytes

Denis Mazur 4 years ago
parent
commit
c92e633f84
1 changed files with 1 additions and 1 deletions
  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_payload: bytes = await self.unary_handlers[request.proto](request.data, remote_id)
             response = p2pd_pb.CallUnaryResponse(callId=request.callId, result=response_payload)
             response = p2pd_pb.CallUnaryResponse(callId=request.callId, result=response_payload)
         except Exception as e:
         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(
         await self.pending_messages.put(
             p2pd_pb.Request(type=p2pd_pb.Request.SEND_RESPONSE_TO_REMOTE, sendResponseToRemote=response)
             p2pd_pb.Request(type=p2pd_pb.Request.SEND_RESPONSE_TO_REMOTE, sendResponseToRemote=response)