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

ArgumentFalsyError

Extends:

ErrorArgumentError → ArgumentFalsyError

Represents that an argument erroneously has a falsy value.

Throw this Error if a parameter must be truthy and can't be represented by a more specific argument error.

See:

Example:

The argument for the parameter item is falsy.
throw new ArgumentFalsyError('item');

Static Method Summary

Static Protected Methods
protected static

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

Builds a default error message for subclasses.

since 0.0.1

Constructor Summary

Public Constructor
public

constructor(name: string, message: string)

Initializes a new instance of the ArgumentFalsyError class.

since 0.0.1

Static Protected Methods

protected static makeFalsyTypedMessage({string}:: *, {string}:: *): * since 0.0.1 source

Builds a default error message for subclasses.

Params:

NameTypeAttributeDescription
{string}: *

[message] - Specified message. Otherwise, a generic message will be created like Argument must have a truthy value. Yours ${type ? is '${type}' : 'does not'.

{string}: *

[type] - value to display in the message. Default is to display no value.

Return:

*

Public Constructors

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

Initializes a new instance of the ArgumentFalsyError class.

Override:

ArgumentError#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 does not.