Construct the Imperative error object. Contains the defaults of the error and optionally captures diagnostics and other information.
control parameters to indicate logging of node-report and more
The message generated/specified for the error - used for display/message/diagnostic purposes
Return additionalDetails
Return causeErrors
Return IImperativeError object
Return errorCode
Accessor for the error message.
: The error message
Return stack info
Return whether or not the error dump should be suppressed
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.
An existing error to be incorporated into the resulting ImperativeError.
The main message text for the resulting ImperativeError. If not supplied,
the existingErr.message value will be used.
A newly created 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.
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.
True if a property was recorded. False otherwise.
Generated using TypeDoc