def on_message(self, message):
        try:
            result = json.loads(message)
        except ValueError as e:
            LOGGER.error('invalid json: %r' % str(e))
            return

        msgid = result.get('msgid')
        if not msgid:
            LOGGER.error('invalid message: %r' % str(e))
            return

        try:
            msg = self.messages.pop(msgid)
        except __HOLE__:
            return

        msg.reply(result)
dataset/ETHPy150Open benoitc/gaffer/gaffer/gafferd/lookup.py/LookupClient.on_message