def METHOD_NAME(self, exc, task_id, args, kwargs, einfo):
    """
    log a bunch of stuff for debugging
    save message: error and outputs: APIMeta: 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
        meta = APIMeta.objects.get(run_uuid=exc.run_uuid)
        meta.status = "An error occurred. See messages for more."
        meta.save(update_fields=["status"])
        Message.create(meta=meta, message_type="error", message=msg).save()
    # TODO is it possible for non-REoptErrors to get here? if so what do we do?
    self.request.chain = None  # stop the chain
    self.request.callback = None
    self.request.chord = None  # this seems to stop the infinite chord_unlock call