Skip to content

Commit

Permalink
adjust code
Browse files Browse the repository at this point in the history
  • Loading branch information
chengcong1 committed Dec 23, 2024
1 parent 103a57a commit 03d023d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions jupyter_server/gateway/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,10 @@ def handle_outgoing_message(self, incoming_msg: str, *args: Any) -> None:
def handle_incoming_message(self, message: str) -> None:
"""Send message to gateway server."""
if self.ws is None and self.ws_future is not None:
if self.ws_future.done() and isinstance(self.ws_future.exception(), Exception):
self.log.warning(f"Exception connect to websocket {self.ws_future.exception()}")
return
if self.ws_future.done() and self.ws_future.exception() is not None:
self.log.warning(
"Ignoring message on failed connection to kernel %s", self.kernel_id
)
loop = IOLoop.current()
loop.add_future(self.ws_future, lambda future: self.handle_incoming_message(message))
else:
Expand Down

0 comments on commit 03d023d

Please sign in to comment.