UNPKG

@zowe/imperative

Version:
112 lines 4.1 kB
import { IImperativeError } from "./doc/IImperativeError"; import { IImperativeErrorParms } from "./doc/IImperativeErrorParms"; /** * * @export * @class ImperativeError * @extends {Error} */ export declare class ImperativeError extends Error { mDetails: IImperativeError; private static readonly RAW_ERR_MSG; /** * The message generated/specified for the error - used for display/message/diagnostic purposes * @private * @type {string} * @memberof ImperativeError */ private mMessage; /** * Construct the Imperative error object. Contains the defaults of the error and optionally captures diagnostics * and other information. * @param {IImperativeError} details - the error details and text (stack, messages, etc.) * @param {IImperativeErrorParms} parms - control parameters to indicate logging of node-report and more */ constructor(mDetails: IImperativeError, parms?: IImperativeErrorParms); /** * Within the Zowe client SDK, errors are often thrown, caught, modified, and re-thrown. * Sometimes the error that we catch is a standard JavaScript Error. Other times the * error is already an ImperativeError (which can contain more details). A hard-coded * reliance on ImperativeError properties like causeErrors and additionalDetails will not * work if the existingErr is a standard JavaScript Error. Also, the properties of an * ImperativeError can be nested under various properties within its causeErrors property. * * The purpose of this utility function is to interrogate the existing error to form the * most meaningful ImperativeError possible. * * @param {string} existingErr * An existing error to be incorporated into the resulting ImperativeError. * * @param {string} mainMsg * The main message text for the resulting ImperativeError. If not supplied, * the existingErr.message value will be used. * * @returns A newly created ImperativeError * @memberof ImperativeError */ static newImpErrorFromExistingError(existingErr: any, mainMsg?: string): ImperativeError; /** * This function interrogates the supplied propertyVal. If it is a string, it it appended * to outputData.stringVal. If propertyVal is not a string and it is not null-or-undefined, * and outputData.rawVal is currently empty, propertyVal is placed into outputData.rawVal. * * @param {IErrOutputData} outputData [output] * One (or neither) of outputData.stringVal or outputData.rawVal properties are * populated by this function. Before the first call to recordPropForOutput, * stringVal should be an empty string and rawVal should be an empty object. * * @returns True if a property was recorded. False otherwise. * @memberof ImperativeError */ private static recordPropForOutput; /** * Return causeErrors * @readonly * @type {any[]} * @memberof ImperativeError */ get causeErrors(): any; /** * Return additionalDetails * @readonly * @type {string} * @memberof ImperativeError */ get additionalDetails(): string; /** * Return IImperativeError object * @readonly * @type {IImperativeError} * @memberof ImperativeError */ get details(): IImperativeError; /** * Return errorCode * @readonly * @type {string} * @memberof ImperativeError */ get errorCode(): string; /** * Return whether or not the error dump should be suppressed * @readonly * @type {string} * @memberof ImperativeError */ get suppressDump(): boolean; /** * Return stack info * @readonly * @type {string} * @memberof ImperativeError */ get stack(): string; /** * Accessor for the error message. * @readonly * @return {string}: The error message * @memberof ImperativeError */ get message(): string; } //# sourceMappingURL=ImperativeError.d.ts.map