/*!
 * Copyright (c) 2026 Vertex Software LLC. All rights reserved.
 */
import { CustomError } from "../../../lib/errors";
export var SceneTreeErrorCode;
(function (SceneTreeErrorCode) {
    SceneTreeErrorCode[SceneTreeErrorCode["UNKNOWN"] = 0] = "UNKNOWN";
    SceneTreeErrorCode[SceneTreeErrorCode["SCENE_TREE_DISABLED"] = 1] = "SCENE_TREE_DISABLED";
    SceneTreeErrorCode[SceneTreeErrorCode["MISSING_VIEWER"] = 2] = "MISSING_VIEWER";
    SceneTreeErrorCode[SceneTreeErrorCode["DISCONNECTED"] = 3] = "DISCONNECTED";
    SceneTreeErrorCode[SceneTreeErrorCode["SUBSCRIPTION_FAILURE"] = 4] = "SUBSCRIPTION_FAILURE";
    SceneTreeErrorCode[SceneTreeErrorCode["UNAUTHORIZED"] = 5] = "UNAUTHORIZED";
    SceneTreeErrorCode[SceneTreeErrorCode["ABORTED"] = 6] = "ABORTED";
})(SceneTreeErrorCode || (SceneTreeErrorCode = {}));
export class SceneTreeErrorDetails {
    constructor(name, code, link) {
        this.name = name;
        this.code = code;
        this.link = link;
        this.message = getSceneTreeErrorMessage(code);
    }
}
function getSceneTreeErrorMessage(code) {
    switch (code) {
        case SceneTreeErrorCode.UNKNOWN:
            return 'An unknown error occurred.';
        case SceneTreeErrorCode.SCENE_TREE_DISABLED:
            return 'The tree for this scene is not enabled. Enable the tree for this scene to interact with the tree.';
        case SceneTreeErrorCode.MISSING_VIEWER:
            return 'Could not find reference to the viewer.';
        case SceneTreeErrorCode.DISCONNECTED:
            return 'Disconnected from server.';
        case SceneTreeErrorCode.SUBSCRIPTION_FAILURE:
            return 'The tree was not able to receive subscription events.';
        case SceneTreeErrorCode.UNAUTHORIZED:
            return 'The tree was unauthorized to connect to the server. The associated Viewer may not be connected.';
        case SceneTreeErrorCode.ABORTED:
            return 'Unable to load the tree for this scene.';
    }
}
export class SceneTreeError extends CustomError {
    constructor(message, e) {
        super(message, e);
        // Allows for `instanceof` checks.
        Object.setPrototypeOf(this, SceneTreeError.prototype);
    }
}
export class SceneTreeUnauthorizedError extends SceneTreeError {
    constructor(message, e) {
        super(message, e);
        // Allows for `instanceof` checks.
        Object.setPrototypeOf(this, SceneTreeUnauthorizedError.prototype);
    }
}
export class SceneTreeConnectionCancelledError extends SceneTreeError {
    constructor(message, e) {
        super(message, e);
        // Allows for `instanceof` checks.
        Object.setPrototypeOf(this, SceneTreeConnectionCancelledError.prototype);
    }
}
export class SceneTreeOperationFailedError extends SceneTreeError {
    constructor(message, e) {
        super(message, e);
        // Allows for `instanceof` checks.
        Object.setPrototypeOf(this, SceneTreeOperationFailedError.prototype);
    }
}
//# sourceMappingURL=errors.js.map
