'Send an error
If you pass ofp, it will be used as the source of the error\'s XID and
data.
You can override the data by also specifying data.'

def send_error(self, type, code, ofp=None, data=None, connection=None):

    err = ofp_error(type=type, code=code)
    if ofp:
        err.xid = ofp.xid
        err.data = ofp.pack()
    else:
        err.xid = 0
    if (data is not None):
        err.data = data
    self.send(err, connection=connection)
