> For the complete documentation index, see [llms.txt](https://error.angular-package.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://error.angular-package.dev/error/overview.md).

# Overview

## `Error {}`

The `Error` object is an extension of the [`CommonError`](/commonerror/overview.md) 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="/pages/GXdNT2b4zHCktwMOBCO9"><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="/pages/3RgFr3AxYItRzky1Z8Kj"><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="/pages/8orEKqBluVa8xEGaGvh8"><code>Error</code></a>.</p> |

### Properties

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p><strong>public static</strong> <a href="/pages/akE6vknq8khSYhbok2vb"><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="/pages/BbVb9Mj2Y9veAqrtKz61#problem"><code>{problem}</code></a>, <a href="/pages/BbVb9Mj2Y9veAqrtKz61#fix"><code>{fix}</code></a> and optional <a href="/pages/BbVb9Mj2Y9veAqrtKz61#id"><code>{id}</code></a> tags.</p> |

### Methods

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p><strong>public static</strong> <a href="/pages/mUNe2R3Rnn68BZeJX7Hz"><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="/pages/UAsNmVmOuYGxNypELFFh">message</a> built of the given required <a href="/pages/mUNe2R3Rnn68BZeJX7Hz#problem-string"><code>problem</code></a>, <a href="/pages/mUNe2R3Rnn68BZeJX7Hz#fix-string"><code>fix</code></a> and optional <a href="/pages/mUNe2R3Rnn68BZeJX7Hz#id-id"><code>id</code></a> on the <a href="/pages/mUNe2R3Rnn68BZeJX7Hz#template-error.template"><code>template</code></a>.</p> |
| <p><strong>public static</strong> <a href="/pages/Yk0fHW48jbBFpZjZoUkS"><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="/pages/8orEKqBluVa8xEGaGvh8"><code>Error</code></a> of any or the given <a href="#id-id">identification</a>.</p>                                                                                                                                                        |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://error.angular-package.dev/error/overview.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
