Create an SfdxError.
The error message.
Action messages. Hints to the users regarding what can be done to fix related issues.
The related command name for this error.
SfdxCommand can return this process exit code.
The message string. Error.message
Sets the name of the command.
The command name.
For convenience this object is returned.
An additional payload for the error.
The payload data.
For convenience this object is returned.
Convert an SfdxError's state to an object.
A plain object representing the state of this error.
Create a new SfdxError.
The message package name used to create the SfdxError.
The message bundle name used to create the SfdxError.
The key within the bundle for the message.
Create a new SfdxError.
The SfdxErrorConfig object used to create the SfdxError.
Convert an Error to an SfdxError.
The error to convert.
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.
// To load a message bundle: Messages.importMessagesDirectory(__dirname); this.messages = Messages.loadMessages('myPackageName', 'myBundleName'); // Note that __dirname should contain a messages folder.
// To throw an error associated with the message from the bundle: throw SfdxError.create('myPackageName', 'myBundleName', 'MyErrorMessageKey', [messageToken1]);
// To throw a non-bundle based error: throw new SfdxError(myErrMsg, 'MyErrorName');