Commit 844c041 1 parent de63be6 commit 844c041 Copy full SHA for 844c041
File tree 1 file changed +10
-4
lines changed
1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change 17
17
18
18
"""Adapter for communication with the Celestial hosts over gRPC"""
19
19
20
+ import os
20
21
import typing
21
22
import grpc
22
23
import time
@@ -52,11 +53,16 @@ def register(self) -> proto.celestial.celestial_pb2.RegisterResponse:
52
53
53
54
:return: The response from the host.
54
55
"""
55
- request = proto .celestial .celestial_pb2 .RegisterRequest (host = self .num )
56
+ try :
57
+ request = proto .celestial .celestial_pb2 .RegisterRequest (host = self .num )
56
58
57
- response : proto .celestial .celestial_pb2 .RegisterResponse = self .stub .Register (
58
- request
59
- )
59
+ response : proto .celestial .celestial_pb2 .RegisterResponse = (
60
+ self .stub .Register (request )
61
+ )
62
+
63
+ except grpc .RpcError as e :
64
+ logging .error (f"Error registering host { self .num } : { e } " )
65
+ os .exit (1 )
60
66
61
67
# others currently not used
62
68
self .peer_public_key = response .peer_public_key
You can’t perform that action at this time.
0 commit comments