"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.TrackerMissingWorkflowLabelSetError = exports.TRACKER_ERROR_CODES = void 0;
exports.isTrackerMissingWorkflowLabelSetError = isTrackerMissingWorkflowLabelSetError;
exports.createTrackerMissingWorkflowLabelSetError = createTrackerMissingWorkflowLabelSetError;
const catalog_1 = require("../../i18n/catalog");
exports.TRACKER_ERROR_CODES = {
    missingWorkflowLabelSet: "missing_workflow_label_set",
};
class TrackerMissingWorkflowLabelSetError extends Error {
    issueId;
    code = exports.TRACKER_ERROR_CODES.missingWorkflowLabelSet;
    constructor(message, issueId) {
        super(message);
        this.issueId = issueId;
        this.name = "TrackerMissingWorkflowLabelSetError";
    }
}
exports.TrackerMissingWorkflowLabelSetError = TrackerMissingWorkflowLabelSetError;
function isTrackerMissingWorkflowLabelSetError(error) {
    return (error instanceof TrackerMissingWorkflowLabelSetError ||
        (error instanceof Error &&
            "code" in error &&
            error.code === exports.TRACKER_ERROR_CODES.missingWorkflowLabelSet));
}
function createTrackerMissingWorkflowLabelSetError(locale, issueId) {
    return new TrackerMissingWorkflowLabelSetError((0, catalog_1.translate)(locale, "ticketTracker.issue.missingWorkflowLabelSet", {
        issueId,
    }), issueId);
}
