import Task from "../Task.js";

/**
 * Always fails by throwing an object that was given (typically an Error instance)
 * @param {*} e value to be thrown
 */
export function failingTask(e) {
    return new Task({
        name: "Failing Task",
        cycleFunction: function () {
            throw e;
        },
        computeProgress: function () {
            return 0;
        }
    });
}
