CustomErrorBase
Home > @backstage/errors
> CustomErrorBase
A base class that custom Error classes can inherit from.
Signature:
class CustomErrorBase extends Error
Extends: Error
Example
class MyCustomError extends CustomErrorBase {
name = 'MyCustomError' as const;
}
const e = new MyCustomError('Some message', cause);
// e.name === 'MyCustomError'
// e.message === 'Some message'
// e.cause === cause
// e.stack is set if the runtime supports it
Constructors
Constructor |
Modifiers |
Description |
---|---|---|
Constructs a new instance of the |
Properties
Property |
Modifiers |
Type |
Description |
---|---|---|---|
|
Error | undefined |
(Optional) An inner error that caused this error to be thrown, if any. |