def METHOD_NAME(task_id: int) -> ResponseValue:
    task = get_task_or_404(task_id)
    try:
        manually_execute_task(task, processor=current_user)
        session.session.commit()
    except Exception as e:
        if not isinstance(e, PycroftException):
            import logging
            logging.getLogger('pycroft.web').error(
                "Unexpected error in manual task execution: %s", e,
                exc_info=True
            )
        flash(f"Fehler bei der Ausführung: {e}", 'error')
        session.session.rollback()
    else:
        flash("Aufgabe erfolgreich ausgeführt", 'success')
    return redirect_or_404(request.args.get("redirect"))