Skip to content

Commit

Permalink
gateway: compatibility with tornado 4
Browse files Browse the repository at this point in the history
HTTPTimeoutError is new in tornado 5.1
  • Loading branch information
minrk committed Mar 5, 2019
1 parent 71e1853 commit be35a37
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions notebook/gateway/managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
from tornado import gen, web
from tornado.escape import json_encode, json_decode, url_escape
from tornado.httpclient import HTTPClient, AsyncHTTPClient, HTTPError
from tornado.simple_httpclient import HTTPTimeoutError

from ..services.kernels.kernelmanager import MappingKernelManager
from ..services.sessions.sessionmanager import SessionManager
Expand Down Expand Up @@ -259,9 +258,9 @@ def gateway_request(endpoint, **kwargs):
except ConnectionRefusedError:
raise web.HTTPError(503, "Connection refused from Gateway server url '{}'. "
"Check to be sure the Gateway instance is running.".format(GatewayClient.instance().url))
except HTTPTimeoutError:
except HTTPError:
# This can occur if the host is valid (e.g., foo.com) but there's nothing there.
raise web.HTTPError(504, "Timeout error attempting to connect to Gateway server url '{}'. " \
raise web.HTTPError(504, "Error attempting to connect to Gateway server url '{}'. " \
"Ensure gateway url is valid and the Gateway instance is running.".format(
GatewayClient.instance().url))
except gaierror as e:
Expand Down

0 comments on commit be35a37

Please sign in to comment.