@zowe/imperative
Version:
framework for building configurable CLIs
96 lines • 3.52 kB
JavaScript
;
/*
* This program and the accompanying materials are made available under the terms of the
* Eclipse Public License v2.0 which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-v20.html
*
* SPDX-License-Identifier: EPL-2.0
*
* Copyright Contributors to the Zowe Project.
*
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.ProfInfoErr = void 0;
const error_1 = require("../../error");
/**
* This class is the error exception mechanism for the ProfileInfo API.
* It is derived from ImperativeError. We use a separate class so that
* our consumer can check the type of error, and then rely on errorCode
* values that are unique to ProfInfoErr. ProfInfoErr will always
* populate the errorCode property. Our consumer can use the errorCode to
* determine if it should process partial results.
*/
class ProfInfoErr extends error_1.ImperativeError {
// _______________________________________________________________________
/**
* Construct the ProfInfoErr error object. It adds properties in
* IProfInfoErrParms to the existing properties of ImperativeError.
*
* @param impErrDetails
* ImperativeError details and text (stack, messages, etc.)
*
* @param profErrParms
* ProfInfoErr parms and ImperativeError control parameters.
*/
constructor(impErrDetails, profErrParms) {
super(impErrDetails, profErrParms);
/**
* Additional error properties, specific to ProfInfoErr.
*/
this.mItemsInError = [];
this.name = "ProfInfoErr";
// make a shallow copy of the itemsInError array
if (profErrParms) {
this.mItemsInError = [...profErrParms.itemsInError];
}
}
get itemsInError() {
return this.mItemsInError;
}
}
exports.ProfInfoErr = ProfInfoErr;
// _______________________________________________________________________
// The following are the complete set of errorCodes for ProfInfoErr.
/**
* Unable to retrieve the schema from a URL reference.
* Currently, the ProfiInfo API does not attempt to retrieve a schema
* through a URL. A URL does work to provide intellisense in VSCode
* when editing a config file.
*/
ProfInfoErr.CANT_GET_SCHEMA_URL = "CantGetSchemaUrl";
/**
* The specified type of profile location is invalid for the requested operation.
*/
ProfInfoErr.INVALID_PROF_LOC_TYPE = "InvalidProfLocType";
/**
* Failed to initialize ProfileCredentials and load the credential manager.
*/
ProfInfoErr.LOAD_CRED_MGR_FAILED = "LoadCredMgrFailed";
/**
* Failed to load the schema for a specified type of profile.
*/
ProfInfoErr.LOAD_SCHEMA_FAILED = "LoadSchemaFailed";
/**
* A required profile property was not assigned a value.
*/
ProfInfoErr.MISSING_REQ_PROP = "MissingProp";
/**
* The ProfileInfo.readProfilesFromDisk function was not called before
* a function which requires that prerequisite.
*/
ProfInfoErr.MUST_READ_FROM_DISK = "MustReadFromDisk";
/**
* A specified property that is expected to exist in a specified profile
* does not exist in that profile.
*/
ProfInfoErr.PROP_NOT_IN_PROFILE = "PropNotInProfile";
/**
* A specified property that is expected to exist in a specified profile
* does not have OS and JSON locations defined.
*/
ProfInfoErr.UNKNOWN_PROP_LOCATION = "UnknownPropLocation";
/**
* A specified profile was not found (V1)
*/
ProfInfoErr.PROF_NOT_FOUND = "ProfileNotFound";
//# sourceMappingURL=ProfInfoErr.js.map