Create an SfError.
The error message.
The error name. Defaults to 'SfError'.
Optionalactions: string[]The action message(s).
OptionalexitCodeOrCause: number | ErrorThe exit code which will be used by SfdxCommand or he underlying error that caused this error to be raised.
Optionalcause: unknownThe underlying error that caused this error to be raised.
OptionalactionsAction messages. Hints to the users regarding what can be done to fix related issues.
OptionalcontextThe related context for this error.
OptionaldataSfdxCommand can return this process exit code.
ReadonlynameConvert an SfError state to an object. Returns a plain object representing the state of this error.
StaticcreateStaticwrap
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.