"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.watchUnitErr = watchUnitErr;
const GRAPH_DEFAULT_EVENTS_1 = require("../constant/GRAPH_DEFAULT_EVENTS");
const callAll_1 = require("../util/call/callAll");
const watchUnitErrEvent_1 = require("./watchUnitErrEvent");
function watchUnitErr(unit, callback, events = GRAPH_DEFAULT_EVENTS_1.GRAPH_DEFAULT_EVENTS) {
    const all = [];
    if (events.includes('err')) {
        all.push((0, watchUnitErrEvent_1.watchUnitErrEvent)('err', unit, callback));
    }
    if (events.includes('take_err')) {
        all.push((0, watchUnitErrEvent_1.watchUnitErrEvent)('take_err', unit, callback));
    }
    if (events.includes('catch_err')) {
        all.push((0, watchUnitErrEvent_1.watchUnitErrEvent)('catch_err', unit, callback));
    }
    return (0, callAll_1.callAll)(all);
}
//# sourceMappingURL=watchUnitErr.js.map