Home Manual Reference Source Repository
public class | since 0.0.1 | source

ArgumentNanError

Extends:

ErrorArgumentErrorArgumentFalsyError → ArgumentNanError

Represents that an argument erroneously has a value of NaN.

Throw this Error if a parameter must be a number.

See:

Example:

The argument for the parameter price is `NaN`.
throw new ArgumentNanError('price');

Constructor Summary

Public Constructor
public

constructor(name: string, message: string)

Initializes a new instance of the ArgumentNanError class.

since 0.0.1

Inherited Summary

From class ArgumentFalsyError
protected static

makeFalsyTypedMessage({string}:: *, {string}:: *): *

Builds a default error message for subclasses.

since 0.0.1

Public Constructors

public constructor(name: string, message: string) since 0.0.1 source

Initializes a new instance of the ArgumentNanError class.

Override:

ArgumentFalsyError#constructor

Params:

NameTypeAttributeDescription
name string
  • optional

The parameter name. Default is no name.

message string
  • optional

Specified message. Otherwise, a generic message will be used like Argument must have a truthy value. Yours is 'NaN'.