UNPKG

@adpt/core

Version:
93 lines 3.41 kB
"use strict"; /* * Copyright 2018-2019 Unbounded Systems, LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ Object.defineProperty(exports, "__esModule", { value: true }); const utils_1 = require("@adpt/utils"); const ts_custom_error_1 = require("ts-custom-error"); const util_1 = require("util"); var utils_2 = require("@adpt/utils"); exports.InternalError = utils_2.InternalError; class BuildNotImplemented extends ts_custom_error_1.CustomError { constructor(message) { super(message); } } exports.BuildNotImplemented = BuildNotImplemented; class ElementNotInDom extends ts_custom_error_1.CustomError { constructor(message) { super(message); } } exports.ElementNotInDom = ElementNotInDom; class ProjectBuildError extends utils_1.UserError { constructor(domXml) { super(`Error building Adapt project`); this.domXml = domXml; } } exports.ProjectBuildError = ProjectBuildError; class ProjectCompileError extends ts_custom_error_1.CustomError { constructor(msg) { super(`Error compiling Adapt project\n${msg}`); } } exports.ProjectCompileError = ProjectCompileError; class ProjectRunError extends ts_custom_error_1.CustomError { constructor(projectError, projectStack, fullStack) { let msg = `Error executing Adapt project: `; msg += projectError.message || projectError.name; super(msg); this.projectError = projectError; this.projectStack = projectStack; this.fullStack = fullStack; } } exports.ProjectRunError = ProjectRunError; class ThrewNonError extends ts_custom_error_1.CustomError { constructor(thrown) { super(`An exception was thrown with a non-Error object: '${util_1.inspect(thrown)}'`); this.thrown = thrown; } } exports.ThrewNonError = ThrewNonError; function isError(val) { return ((val != null) && (typeof val.message === "string") && (typeof val.name === "string") && (val.stack === undefined || typeof val.stack === "string")); } exports.isError = isError; class DeployStepIDNotFound extends ts_custom_error_1.CustomError { constructor(opID, stepNum) { super(`Deployment step ID ${opID}.${stepNum} not found`); } } exports.DeployStepIDNotFound = DeployStepIDNotFound; class DeploymentNotActive extends ts_custom_error_1.CustomError { constructor(deployID) { super(`Deployment ${deployID} is not yet active. ` + `(DeployOpID 0 has not been deployed)`); } } exports.DeploymentNotActive = DeploymentNotActive; class DeploymentOpIDNotActive extends ts_custom_error_1.CustomError { constructor(deployID, opID) { super(`Deployment operation ID ${opID} for Deployment ${deployID} ` + `is not yet active. (Step 0 has not been deployed)`); } } exports.DeploymentOpIDNotActive = DeploymentOpIDNotActive; //# sourceMappingURL=error.js.map