def METHOD_NAME(self, exc, task_id, args, kwargs, einfo):
    """
    log a bunch of stuff for debugging
    save message: error and outputs: Scenario: status
    :param exc: The exception raised by the task.
    :param task_id: Unique id of the failed task. (not the run_uuid)
    :param args: Original arguments for the task that failed.
    :param kwargs: Original keyword arguments for the task that failed.
    :param einfo: ExceptionInfo instance, containing the traceback.
    :return: None, The return value of this handler is ignored.
    """
    if isinstance(exc, REoptError):
        exc.save_to_db()
        msg = exc.message
    else:
        msg = exc.args[0]
    data = kwargs['data']
    data["messages"]["error"] = msg
    data["outputs"]["Scenario"]["status"] = "An error occurred. See messages for more."
    ModelManager.update_scenario_and_messages(data, run_uuid=data['outputs']['Scenario']['run_uuid'])
    self.request.chain = None  # stop the chain
    self.request.callback = None
    self.request.chord = None  # this seems to stop the infinite chord_unlock call