Class: InvalidTypeError

InvalidTypeError(error, optionsopt)

This error is typically thrown when a value does not match the expected type.

Constructor

new InvalidTypeError(error, optionsopt)

Parameters:
Name Type Attributes Description
error string | Error

The error message or an instance of an Error.

options Object <optional>

Additional options for the error.

Properties
Name Type Attributes Description
actualType string <optional>

The actual type of the value that caused the error.

expectedType string <optional>

The expected type of the value.

cause Error <optional>

The underlying error that caused this error, if applicable.

Since:
  • 1.1.0
Source:

Extends

  • Error