Skip to main content

AbortError

Callable


  • AbortError constructor

Index

Constructor

readonlycreate

create: (...properties: [properties?: ParametersProperties<AbortError>]) => AbortError

Return a new CustomError

@example
const MyError = CustomError.define('MyError1');
const error = MyError.create({
message: 'my custom message', // customize message (optional)
cause: parentError, // Error that caused this error (optional)
})

Other

readonlyerrorName

errorName: AbortError

The model name constant. Can be useful for switch / case statements.

@example
const error: SomeError;
switch (error.name) {
case SomeError.errorName: //...
}

readonlyhasInstance

hasInstance: (anyValue: unknown) => anyValue is AbortError

Predicate that returns true when anyValue is a Model The implementation compares anyValue.name === Module.errorName

@example
const MyError = CustomError.define('MyError1');
const unknownError: unknown;
if (MyError.hasInstance(unknownError)) {
// unknownError.name === 'MyError1'
}
Page Options