Skip to content

Commit 0839c93

Browse files
author
chengcong
committed
adjust code
1 parent 0a35f5d commit 0839c93

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

jupyter_server/gateway/connections.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,10 +146,10 @@ def handle_outgoing_message(self, incoming_msg: str, *args: Any) -> None:
146146
def handle_incoming_message(self, message: str) -> None:
147147
"""Send message to gateway server."""
148148
if self.ws is None and self.ws_future is not None:
149-
loop = IOLoop.current()
150-
if self.ws_future.done():
151-
self.log.error(f"Exception connect to gateway server {self.ws_future.exception()}")
149+
if self.ws_future.done() and isinstance(self.ws_future.exception, Exception):
150+
self.log.warning(f"Exception connect to websocket {self.ws_future.exception()}")
152151
return
152+
loop = IOLoop.current()
153153
loop.add_future(self.ws_future, lambda future: self.handle_incoming_message(message))
154154
else:
155155
self._write_message(message)

0 commit comments

Comments
 (0)