Skip to content

Commit 03d023d

Browse files
author
chengcong1
committed
adjust code
1 parent 103a57a commit 03d023d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

jupyter_server/gateway/connections.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +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-
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()}")
151-
return
149+
if self.ws_future.done() and self.ws_future.exception() is not None:
150+
self.log.warning(
151+
"Ignoring message on failed connection to kernel %s", self.kernel_id
152+
)
152153
loop = IOLoop.current()
153154
loop.add_future(self.ws_future, lambda future: self.handle_incoming_message(message))
154155
else:

0 commit comments

Comments
 (0)