Skip to content

Commit

Permalink
client: catch exception when hub connection fails
Browse files Browse the repository at this point in the history
  • Loading branch information
rhyw committed Apr 2, 2024
1 parent 37ea28d commit 65ae586
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion kobo/client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ def run(self, *args, **kwargs):
import base64
import hashlib
import ssl
import sys
import warnings
import six.moves.urllib.parse as urlparse
from six.moves import xmlrpc_client as xmlrpclib
Expand Down Expand Up @@ -111,7 +112,11 @@ def set_hub(self, username=None, password=None, hub=None):
if hub:
self.conf["HUB_URL"] = hub

self.hub = HubProxy(conf=self.conf)
try:
self.hub = HubProxy(conf=self.conf)
except Exception as ex:
print(f"Failed to initialize hub proxy: {ex}", file=sys.stderr)
sys.exit(1)


class ClientCommandContainer(BaseClientCommandContainer):
Expand Down

0 comments on commit 65ae586

Please sign in to comment.