def on_message(self, message):
"""Handle a message received on the websocket."""
cmd = self.unpack(message)
try:
CommandMessage.verify(cmd)
self._on_command(cmd)
except ValidationError:
if 'operation' in cmd:
self.logger.exception("Invalid operation received: %s", cmd['operation'])
self.send_error('message did not correspond with a known schema')
评论列表
文章目录