Remove potentially harmful 'error handling'

This commit is contained in:
Kristóf Tóth 2019-05-09 15:12:42 +02:00
parent 9e36bde974
commit 1bfaac0493

View File

@ -39,15 +39,9 @@ class CallbackPipeIOServer(PipeIOServer):
class PipeIOEventHandler(PipeIOEventHandlerBase):
def handle_event(self, message):
try:
json_bytes = dumps(message).encode()
self.pipe_io.send_message(json_bytes)
except TypeError:
LOG.error("Message %s not JSON serializable! Ignoring...", message)
json_bytes = dumps(message).encode()
self.pipe_io.send_message(json_bytes)
def handle_pipe_event(self, message):
try:
json = loads(message)
self.server_connector.send(json)
except JSONDecodeError:
LOG.error("Invalid JSON received on %s! Ignoring...", self.pipe_io.in_pipe)
json = loads(message)
self.server_connector.send(json)