Skip to content

Commit

Permalink
Trap gRPC errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jim-carciofini committed May 7, 2024
1 parent 84fa27f commit dfd59cb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pate_binja/mcad/PateMcad.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,11 @@ def request_cycle_counts(self, instructions: list[bytes]) -> List[CycleCount]:
if not self.isRunning():
return []
pbInstructions = map(lambda b: binja_pb2.BinjaInstructions.Instruction(opcode=b), instructions)
pbCycleCounts = self.stub.RequestCycleCounts(binja_pb2.BinjaInstructions(instruction=pbInstructions))
try:
pbCycleCounts = self.stub.RequestCycleCounts(binja_pb2.BinjaInstructions(instruction=pbInstructions))
except grpc.RpcError as rpc_error:
print("gRPC Call failure: %s", rpc_error)
return []
return list(map(lambda cc: CycleCount(cc.ready, cc.executed, cc.is_under_pressure), pbCycleCounts.cycle_count))


Expand Down

0 comments on commit dfd59cb

Please sign in to comment.