mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2024-11-22 18:41:32 +00:00
Remove potentially harmful 'error handling'
This commit is contained in:
parent
9e36bde974
commit
1bfaac0493
@ -39,15 +39,9 @@ class CallbackPipeIOServer(PipeIOServer):
|
|||||||
|
|
||||||
class PipeIOEventHandler(PipeIOEventHandlerBase):
|
class PipeIOEventHandler(PipeIOEventHandlerBase):
|
||||||
def handle_event(self, message):
|
def handle_event(self, message):
|
||||||
try:
|
json_bytes = dumps(message).encode()
|
||||||
json_bytes = dumps(message).encode()
|
self.pipe_io.send_message(json_bytes)
|
||||||
self.pipe_io.send_message(json_bytes)
|
|
||||||
except TypeError:
|
|
||||||
LOG.error("Message %s not JSON serializable! Ignoring...", message)
|
|
||||||
|
|
||||||
def handle_pipe_event(self, message):
|
def handle_pipe_event(self, message):
|
||||||
try:
|
json = loads(message)
|
||||||
json = loads(message)
|
self.server_connector.send(json)
|
||||||
self.server_connector.send(json)
|
|
||||||
except JSONDecodeError:
|
|
||||||
LOG.error("Invalid JSON received on %s! Ignoring...", self.pipe_io.in_pipe)
|
|
||||||
|
Loading…
Reference in New Issue
Block a user