Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ImperativeError

export

Hierarchy

Index

Constructors

constructor

Properties

mDetails

Private mMessage

mMessage: string

The message generated/specified for the error - used for display/message/diagnostic purposes

memberof

ImperativeError

name

name: string

Static Error

Error: ErrorConstructor

Static Private Readonly RAW_ERR_MSG

RAW_ERR_MSG: "Raw error data from operation:" = "Raw error data from operation:"

Accessors

additionalDetails

  • get additionalDetails(): string

causeErrors

  • get causeErrors(): any

details

errorCode

  • get errorCode(): string

message

  • get message(): string

stack

  • get stack(): string

suppressDump

  • get suppressDump(): boolean

Methods

Static newImpErrorFromExistingError

  • newImpErrorFromExistingError(existingErr: any, mainMsg?: string): ImperativeError
  • 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.

    memberof

    ImperativeError

    Parameters

    • existingErr: any
       An existing error to be incorporated into the resulting ImperativeError.
      
    • Default value mainMsg: string = ""
       The main message text for the resulting ImperativeError. If not supplied,
       the existingErr.message value will be used.
      

    Returns ImperativeError

    A newly created ImperativeError

Static Private recordPropForOutput

  • recordPropForOutput(propertyVal: any, outputData: IErrOutputData): boolean
  • 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.

    memberof

    ImperativeError

    Parameters

    • propertyVal: any
    • outputData: IErrOutputData
       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 boolean

    True if a property was recorded. False otherwise.

Generated using TypeDoc