Page cover image

Overview

The `CommonError` abstract object to throw an identified error with a solution to the described problem

CommonError {}

The CommonError abstract object to throw an identified error with a solution to the described problem, additional type, and range built on the template.

common-error.class.ts

Accessors

public get fix(): string The get accessor obtains a possible solution to the described problem by returning the #fix property of a specified object

public get id(): Id | undefined The get accessor gets the error identification by returning the #id property of a specified object.

public get link(): string | undefined The get accessor gets the link(to read more about the thrown error) by returning the #link property of a specified object.

public get message(): string The get accessor gets the error message by returning the parent message property of the Error object.

public get problem(): string The get accessor gets the problem by returning the #problem property of a specified object.

public get template(): string The get accessor gets the template of the error message by returning the #template property of a specified object.

Properties

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

#fix: string A privately stored possible solution to the described problem of a string type.

#id?: Id A privately stored unique identification of the described problem of generic type variable Id.

#link?: string The optional privately stored link of string type redirects to read more about the thrown error.

#problem: string A privately stored problem of a string type.

#template: string A string-type privately stored template of the error message that contains replaceable required {fix}, {problem} and optional {id}, {max}, {min}, {type} tags.

Methods

protected static defineMessage(): string The static "tag" method builds from the given values the error message of a string type on the template.

protected static isError(): value is CommonError<Id> Checks whether the value of any type is a this instance of any or the given identification.

Last updated

Was this helpful?