Skip to content

Commit

Permalink
throw error in registration
Browse files Browse the repository at this point in the history
  • Loading branch information
pfandzelter committed Jun 18, 2024
1 parent de63be6 commit 807bc64
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions celestial/host.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,16 @@ def register(self) -> proto.celestial.celestial_pb2.RegisterResponse:
:return: The response from the host.
"""
request = proto.celestial.celestial_pb2.RegisterRequest(host=self.num)
try:
request = proto.celestial.celestial_pb2.RegisterRequest(host=self.num)

response: proto.celestial.celestial_pb2.RegisterResponse = self.stub.Register(
request
)
response: proto.celestial.celestial_pb2.RegisterResponse = (
self.stub.Register(request)
)

except grpc.RpcError as e:
logging.error(f"Error registering host {self.num}: {e}")
exit(1)

# others currently not used
self.peer_public_key = response.peer_public_key
Expand Down

0 comments on commit 807bc64

Please sign in to comment.