Error thrown when the input cannot be parsed to a date or duration. It optionally accepts a detail parameter that can be used to provide more information about why parsing failed.

Hierarchy

  • Error
    • InvalidInputError

Constructors

  • Create a new InvalidInputError instance with the given input, optionally providing a detail parameter to describe why parsing failed. The detail parameter will be included in the error message if provided.

    Parameters

    • input: string

      The input that could not be parsed

    • Optional detail: string

      A more detailed description of the error

    Returns InvalidInputError

Properties

_detail: string

An optional detailed description of the reason why parsing failed.

_input: string

The input that could not be parsed.

cause?: unknown
message: string
name: string
stack?: string
prepareStackTrace?: ((err, stackTraces) => any)

Type declaration

stackTraceLimit: number

Accessors

  • get detail(): string
  • Get the detail explaining why parsing failed. If no detail was provided, it will return an empty string.

    Returns string

    The detail string.

Methods

  • Create .stack property on a target object

    Parameters

    • targetObject: object
    • Optional constructorOpt: Function

    Returns void