Overview

The `RangeError` object

RangeError {}

The RangeError object is an extension of the CommonError class and is thrown when a value is not in the set or range of allowed values with the message built from the described problem and its solution, optional explicit identification and minimum/maximum range on the given or stored template.

range-error.class.ts

Accessors

public get max(): Max | undefined The get accessor obtains the maximum range of generic type variable Max that causes an error to be thrown(or not thrown), if set, otherwise returns undefined.

public get min(): Min | undefined The get accessor obtains the minimum range of generic type variable Min that causes an error to be thrown(or not thrown), if set, otherwise returns undefined.

public get name(): string Error name of a string type, set to 'RangeError' that is being thrown.

public get range(): { min?: Min; max?: Max } The get accessor obtains the minimum and maximum range in the form of an object.

public get [Symbol.toStringTag](): string The get accessor, with the help of toStringTag, changes the default tag to 'RangeError' for an instance of RangeError.

Properties

public static template: string A template of the error message of string type with the replaceable {problem}, {fix} and optional {id}, {max}, {min} tags.

#max?: Max Private property of the maximum range of generic type variable Max that causes an error to be thrown(or not thrown).

#min?: Min Private property of the minimum range of generic type variable Min that causes an error to be thrown(or not thrown).

Methods

public static define(): RangeError<Id, Min, Max> Defines the RangeError instance with the message built from the given required problem, fix and optional id, max, min on the given or stored template.

public static isRangeError(): value is RangeError<Id, Min, Max> Checks whether the value of any type is an instance of RangeError of any or the given minimum/maximum range and identification.

Last updated