UNPKG

@enonic/mock-xp

Version:

Mock Enonic XP API JavaScript Library

48 lines (47 loc) 2.07 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.NodeAlreadyExistAtPathException = exports.NODE_ALREADY_EXIST_AT_PATH_EXCEPTION_NAME = void 0; var tslib_1 = require("tslib"); var RuntimeException_1 = require("../exception/RuntimeException"); exports.NODE_ALREADY_EXIST_AT_PATH_EXCEPTION_NAME = 'com.enonic.xp.node.NodeAlreadyExistAtPathException'; var NodeAlreadyExistAtPathException = (function (_super) { tslib_1.__extends(NodeAlreadyExistAtPathException, _super); function NodeAlreadyExistAtPathException(nodePath, repositoryId, branch) { var _this = this; if (arguments.length === 1) { _this = _super.call(this, nodePath) || this; } else { _this = _super.call(this, NodeAlreadyExistAtPathException.buildMessage(nodePath, repositoryId, branch)) || this; } _this.node = nodePath; _this.repositoryId = repositoryId; _this.branch = branch; if (Error.captureStackTrace) { Error.captureStackTrace(_this, NodeAlreadyExistAtPathException); } _this.name = exports.NODE_ALREADY_EXIST_AT_PATH_EXCEPTION_NAME; return _this; } NodeAlreadyExistAtPathException.buildMessage = function (nodePath, repositoryId, branch) { var message = "Node already exists at path ".concat(nodePath); if (repositoryId) { message += " repository: ".concat(repositoryId); } if (branch) { message += " branch: ".concat(branch.id); } return message; }; NodeAlreadyExistAtPathException.prototype.getBranch = function () { return this.branch; }; NodeAlreadyExistAtPathException.prototype.getNode = function () { return this.node; }; NodeAlreadyExistAtPathException.prototype.getRepositoryId = function () { return this.repositoryId; }; return NodeAlreadyExistAtPathException; }(RuntimeException_1.RuntimeException)); exports.NodeAlreadyExistAtPathException = NodeAlreadyExistAtPathException;