'Called when read() has an error
reason is one of OFConnection.ERR_X
info depends on reason:
ERR_BAD_VERSION: claimed version number
ERR_NO_UNPACKER: (claimed message type, claimed length)
ERR_BAD_LENGTH: (unpacked message, claimed length, unpacked length)
ERR_EXCEPTION: (exception, raw message, unpacked message)
Return False to halt processing of subsequent data (makes sense to
do this if you called connection.close() here, for example).'

def _error_handler(self, reason, info):

    if (reason == OFConnection.ERR_BAD_VERSION):
        ofp_version = info
        self.log.warn('Unsupported    OpenFlow    version    0x%02x', info)
        if self.starting:
            message = self.io_worker.peek()
            err = ofp_error(type=OFPET_HELLO_FAILED, code=OFPHFC_INCOMPATIBLE)
            err.xid = self._extract_message_xid(message)
            err.data = 'Version    unsupported'
            self.send(err)
        self.close()
        return False
    elif (reason == OFConnection.ERR_NO_UNPACKER):
        (ofp_type, message_length) = info
        self.log.warn('Unsupported    OpenFlow    message    type    0x%02x', ofp_type)
        message = self.io_worker.peek()
        err = ofp_error(type=OFPET_BAD_REQUEST, code=OFPBRC_BAD_TYPE)
        err.xid = self._extract_message_xid(message)
        err.data = message[:message_length]
        self.send(err)
    elif (reason == OFConnection.ERR_BAD_LENGTH):
        (msg_obj, message_length, new_offset) = info
        t = type(msg_obj).__name__
        self.log.error(('Different    idea    of    message    length    for    %s    (us:%s    them:%s)' % (t, new_offset, message_length)))
        message = self.io_worker.peek()
        err = ofp_error(type=OFPET_BAD_REQUEST, code=OFPBRC_BAD_LEN)
        err.xid = self._extract_message_xid(message)
        err.data = message[:message_length]
        self.send(err)
    elif (reason == OFConnection.ERR_EXCEPTION):
        (ex, raw_message, msg_obj) = info
        t = type(ex).__name__
        self.log.exception(('Exception    handling    %s' % (t,)))
    else:
        self.log.error('Unhandled    error')
        self.close()
        return False
