# Overview

## `Error {}`

The `Error` object is an extension of the [`CommonError`](https://error.angular-package.dev/commonerror) class and is thrown when a runtime error occurs with a [message](https://app.gitbook.com/s/23iV8ygEQUrhqw7I3D8g/~/changes/lXvTfsmAkHoNRKsQjxlq/commonerror/accessors/get-message) built from a [solution](https://app.gitbook.com/s/23iV8ygEQUrhqw7I3D8g/~/changes/lXvTfsmAkHoNRKsQjxlq/commonerror/accessors/get-fix) to the described [problem](https://app.gitbook.com/s/23iV8ygEQUrhqw7I3D8g/~/changes/lXvTfsmAkHoNRKsQjxlq/commonerror/accessors/get-problem) but with additional identification, on the [template](https://app.gitbook.com/s/23iV8ygEQUrhqw7I3D8g/~/changes/lXvTfsmAkHoNRKsQjxlq/commonerror/accessors/get-template).

{% embed url="<https://github.com/angular-package/error/blob/main/src/lib/error.class.ts>" %}
`error.class.ts`
{% endembed %}

### Accessors

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p><strong>public get</strong> <a href="accessors/get-name"><strong>name()</strong></a><strong>:</strong> <mark style="color:green;">string</mark><br>Error name of a <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String"><code>string</code></a> type, set to <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error"><code>Error</code></a> that is being thrown.</p>                                                                                                                                                                                                                                    |
| <p><strong>public get</strong> <a href="accessors/get-symbol.tostringtag"><strong>[Symbol.</strong><mark style="color:blue;"><strong>toStringTag</strong></mark><strong>](https://error.angular-package.dev/error)</strong></a><strong>:</strong> <mark style="color:green;">string</mark><br>The <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get"><code>get</code></a> accessor, with the help of <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/toStringTag"><code>toStringTag</code></a>, changes the default tag to <code>'Error'</code> for an instance of <a href=""><code>Error</code></a>.</p> |

### Properties

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p><strong>public static</strong> <a href="../commonerror/properties/static-template"><strong>template</strong></a><strong>:</strong> <mark style="color:green;">string</mark><br>A template of the error message of <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String"><code>string</code></a> type with the replaceable <a href="../../commonerror/constructor#problem"><code>{problem}</code></a>, <a href="../../commonerror/constructor#fix"><code>{fix}</code></a> and optional <a href="../../commonerror/constructor#id"><code>{id}</code></a> tags.</p> |

### Methods

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p><strong>public static</strong> <a href="methods/static-define"><strong>define()</strong></a><strong>:</strong> <mark style="color:green;">Error</mark><<mark style="color:green;">Id</mark>><br>Defines the <a href="#error"><code>Error</code></a> instance with the <a href="../commonerror/accessors/get-message">message</a> built of the given required <a href="../methods/static-define#problem-string"><code>problem</code></a>, <a href="../methods/static-define#fix-string"><code>fix</code></a> and optional <a href="../methods/static-define#id-id"><code>id</code></a> on the <a href="../methods/static-define#template-error.template"><code>template</code></a>.</p> |
| <p><strong>public static</strong> <a href="methods/static-iserror"><strong>isError()</strong></a><strong>:</strong> value is <mark style="color:green;">Error</mark><<mark style="color:green;">Id</mark>><br>Checks whether the <a href="#value-any"><code>value</code></a> of <a href="https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#any"><code>any</code></a> type is an instance of <a href=""><code>Error</code></a> of any or the given <a href="#id-id">identification</a>.</p>                                                                                                                                                                               |
