githubEdit

★ Constructor

The `Error` object constructor

Error()

Creates the Error instance with the message built from the given described problem and its solution, optional explicit identification on the given or stored template.

error.class.ts
constructor(
  problem: string,
  fix: string,
  id?: Id,
  template = Error.template
) {
  super(problem, fix, id, template);
}

Parameters

Description of the problem of a stringarrow-up-right type.

A solution to the given problem of a stringarrow-up-right type.

id?:Id

Optional unique identification to the given problem of generic type variable Id.

template:stringarrow-up-right=Error.template

A template of error message with the replaceable {problem}, {fix} and optional {id} tags. By default, the value is equal to the static property template.

Example usage

Last updated