Creates a new instance of the Basalt error.
Optional
basaltErrorOptions: Readonly<BasaltErrorOptions<T>>The options for the Basalt error. (BasaltErrorOptions)
Readonly
causeOptional
stackStatic
Optional
prepareOptional override for formatting stack traces
Static
stackGets the error code.
Gets the column number where the error occurred (if available).
Gets the date when the error was created.
Gets the fileName where the error occurred (if available).
Gets the line number where the error occurred (if available).
Gets the unique identifier of the error.
Static
captureCreate .stack property on a target object
Optional
constructorOpt: FunctionCreate .stack property on a target object
Optional
constructorOpt: Function
Basalt error class that extends the (Error) class and provides additional properties. (uuidError, date, code, fileName, line, column)
Typeparam
T - The type of the cause of the error.
Example
The following example demonstrates how to throw a new instance of the Basalt error.
Example
The following example demonstrates how to create a new instance of the Basalt error with provided type for the cause.