'Kills this flow with an error.'

def Error(self, backtrace, client_id=None, status=None):

    client_id = (client_id or self.runner_args.client_id)
    if self.IsRunning():
        reply = rdf_flows.GrrStatus()
        if (status is None):
            reply.status = rdf_flows.GrrStatus.ReturnedStatus.GENERIC_ERROR
        else:
            reply.status = status
        if backtrace:
            reply.error_message = backtrace
        self.flow_obj.Terminate(status=reply)
        self.context.state = rdf_flows.FlowContext.State.ERROR
        if backtrace:
            logging.error('Error    in    flow    %s    (%s).    Trace:    %s', self.session_id, client_id, backtrace)
            self.context.backtrace = backtrace
        else:
            logging.error('Error    in    flow    %s    (%s).', self.session_id, client_id)
        self.Notify('FlowStatus', client_id, ('Flow    (%s)    terminated    due    to    error' % self.session_id))
