mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-15 14:03:02 +00:00
log error when failing to connect to Hub
for better diagnosis
This commit is contained in:
@@ -243,7 +243,8 @@ class HubAuth(Configurable):
|
|||||||
headers.setdefault('Authorization', 'token %s' % self.api_token)
|
headers.setdefault('Authorization', 'token %s' % self.api_token)
|
||||||
try:
|
try:
|
||||||
r = requests.request(method, url, **kwargs)
|
r = requests.request(method, url, **kwargs)
|
||||||
except requests.ConnectionError:
|
except requests.ConnectionError as e:
|
||||||
|
self.log.error("Error connecting to %s: %s", self.api_url, e)
|
||||||
msg = "Failed to connect to Hub API at %r." % self.api_url
|
msg = "Failed to connect to Hub API at %r." % self.api_url
|
||||||
msg += " Is the Hub accessible at this URL (from host: %s)?" % socket.gethostname()
|
msg += " Is the Hub accessible at this URL (from host: %s)?" % socket.gethostname()
|
||||||
if '127.0.0.1' in self.api_url:
|
if '127.0.0.1' in self.api_url:
|
||||||
|
Reference in New Issue
Block a user