Skip to content

API ReferenceErrorsClass

InvalidArgumentError

This error is thrown if some operation has invalid values for one or more arguments. The error also contains an array of fieldNames that were invalid.

Extends

Constructors

Constructor

new InvalidArgumentError(
message,
fieldNames?,
cause?
): InvalidArgumentError;

Parameters

ParameterTypeDefault value
messagestringundefined
fieldNamesstring[][]
cause?unknownundefined

Returns

InvalidArgumentError

Overrides

BaseError.constructor

Properties

fieldNames

readonly fieldNames: string[] = [];

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.

Inherited from

BaseError.walk