mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2024-11-22 07:21: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()
|
||||
|
||||
def handle_event(self, message):
|
||||
json_bytes = dumps(message).encode()
|
||||
self._pipe_io_server.send_message(json_bytes)
|
||||
try:
|
||||
json_bytes = dumps(message).encode()
|
||||
self._pipe_io_server.send_message(json_bytes)
|
||||
except TypeError:
|
||||
LOG.error("Message %s not JSON serializable! Ignoring...", message)
|
||||
|
||||
|
||||
|
||||
class JSONProxyPipeIOServer(PipeIOServer):
|
||||
|
Loading…
Reference in New Issue
Block a user