'Called when a stream:error element has been received.
Dispatches a L{STREAM_ERROR_EVENT} event with the error element to
allow for cleanup actions and drops the connection.
@param errelem: The received error element.
@type errelem: L{domish.Element}'

def onStreamError(self, errelem):

    self.dispatch(failure.Failure(error.exceptionFromStreamError(errelem)), STREAM_ERROR_EVENT)
    self.transport.loseConnection()
