mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2024-11-22 18:41:32 +00:00
Handle JSON serialization errors in PipeIOEventHandler
This commit is contained in:
parent
f94d571d19
commit
bb8e0c7458
@ -23,8 +23,12 @@ class PipeIOEventHandler(EventHandlerBase):
|
|||||||
self._pipe_io_server.stop()
|
self._pipe_io_server.stop()
|
||||||
|
|
||||||
def handle_event(self, message):
|
def handle_event(self, message):
|
||||||
|
try:
|
||||||
json_bytes = dumps(message).encode()
|
json_bytes = dumps(message).encode()
|
||||||
self._pipe_io_server.send_message(json_bytes)
|
self._pipe_io_server.send_message(json_bytes)
|
||||||
|
except TypeError:
|
||||||
|
LOG.error("Message %s not JSON serializable! Ignoring...", message)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class JSONProxyPipeIOServer(PipeIOServer):
|
class JSONProxyPipeIOServer(PipeIOServer):
|
||||||
|
Loading…
Reference in New Issue
Block a user