Skip to content

Commit 47bc01e

Browse files
committed
Add comments for the timeout error
1 parent 5e73029 commit 47bc01e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

jupyter_server_proxy/handlers.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,10 @@ async def proxy(self, host, port, proxied_path):
217217
try:
218218
response = await client.fetch(req, raise_error=False)
219219
except httpclient.HTTPError as err:
220+
# We need to capture the timeout error even with raise_error=False,
221+
# because it only affects the HTTPError raised when a non-200 response
222+
# code is used, instead of suppressing all errors.
223+
# Ref: https://www.tornadoweb.org/en/stable/httpclient.html#tornado.httpclient.AsyncHTTPClient.fetch
220224
if err.code == 599:
221225
self._record_activity()
222226
self.set_status(599)

0 commit comments

Comments
 (0)