Skip to content

Commit

Permalink
exit on communication failure
Browse files Browse the repository at this point in the history
  • Loading branch information
jnumainville committed Apr 19, 2024
1 parent 802361f commit 60d15bb
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion plugins/ui/src/deephaven/ui/object_types/ElementMessageStream.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import io
import json
import sys

from jsonrpc import JSONRPCResponseManager, Dispatcher
import logging
import threading
Expand Down Expand Up @@ -352,4 +354,11 @@ def _send_document_update(
logger.debug("Registering callable %s", callable_id)
dispatcher[callable_id] = wrap_callable(callable)
self._dispatcher = dispatcher
self._connection.on_data(payload.encode(), new_objects)
try:
self._connection.on_data(payload.encode(), new_objects)
except RuntimeError as e:
if "io.deephaven.plugin.type.ObjectCommunicationException" in str(e):
# can no longer send, don't need to raise exception but do need to exit
sys.exit()
else:
raise e

0 comments on commit 60d15bb

Please sign in to comment.