Skip to content

API ReferenceErrorsClass

BaseError

Base class for all Anvil SDK service errors.

Extends

  • Error

Extended by

Constructors

Constructor

new BaseError(message, cause?): BaseError;

Parameters

ParameterType
messagestring
cause?unknown

Returns

BaseError

Overrides

Error.constructor;

Methods

walk()

walk<T>(errorType): T | undefined;

Checks if the provided ErrorType is in the error hierarchy for the current error.

Type Parameters

Type ParameterDescription
T extends ErrorThe type of the error being searched for.

Parameters

ParameterTypeDescription
errorType(…args) => TThe error type to find.

Returns

T | undefined

The error, if it is found in the hierarchy, otherwise undefined.