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

ArgumentError

Extends:

Error → ArgumentError

Represents that an argument has violated a requirement.

Throw this Error if a parameter has violated a requirement that can't be represented by a more specific argument error.

Note: ArgumentError is the base class for all the Jali argument errors.

Note: The default message in all Jali argument error classes begin with Error in argument if name is not specified; otherwise Error in argument ' argument-name ' is used. If message is specified, a colon is prefixed. All Jali subclasses specify a message.

See:

Example:

The argument for the parameter pairs has an odd number of elements.
throw new ArgumentError('pairs', `Argument must have an even number of elements. Yours has ` +
  `'${pairs.length}'`);

Constructor Summary

Public Constructor
public

constructor(name: string, message: string)

Initializes a new instance of the ArgumentError class.

since 0.0.1

Public Constructors

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

Initializes a new instance of the ArgumentError class.

Params:

NameTypeAttributeDescription
name string
  • optional

The parameter name. Default is no name.

message string
  • optional

An optional message. Default is no message. See class documentation for more details.*.