Create an SfError.
The error message.
The error name. Defaults to 'SfError'.
Optional
actions: string[]The action message(s).
Optional
exitCodeOrCause: number | ErrorThe exit code which will be used by SfdxCommand or he underlying error that caused this error to be raised.
Optional
cause: unknownThe underlying error that caused this error to be raised.
Optional
actionsAction messages. Hints to the users regarding what can be done to fix related issues.
Optional
contextThe related context for this error.
Optional
dataSfdxCommand can return this process exit code.
Readonly
nameConvert an SfError state to an object. Returns a plain object representing the state of this error.
Static
createStatic
wrap
A generalized sfdx error which also contains an action. The action is used in the CLI to help guide users past the error.
To throw an error in a synchronous function you must either pass the error message and actions directly to the constructor, e.g.