Skip to content

Commit d085725

Browse files
author
Andy Clegg
committed
Add target context to connection error
1 parent af24427 commit d085725

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

nameko_grpc/channel.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,10 @@ def get(self):
7777
def start(self):
7878
self.run = True
7979
for target in self.targets:
80-
self.connect(urlparse(target))
80+
try:
81+
self.connect(urlparse(target))
82+
except OSError as e:
83+
raise type(e)(f"Failed to connect to {target}") from e
8184

8285
def stop(self):
8386
self.run = False

0 commit comments

Comments
 (0)