> 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/commonerror/overview.md).

# Overview

## `CommonError {}`

The `CommonError` abstract object to throw an [identified](/getting-started/basic-concepts.md#identification) error with a [solution](/getting-started/basic-concepts.md#fix) to the described [problem](/getting-started/basic-concepts.md#problem), additional [type](/getting-started/basic-concepts.md#type), and [range](/getting-started/basic-concepts.md#range) built on the [template](/getting-started/basic-concepts.md#template).

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

### Accessors

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |                                                                                                                                                                                                                                                                                                                                                                                   |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p><strong>public get</strong> <a href="/pages/59loEPLx3eMsMq3XEWAP"><strong>fix()</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 obtains a possible <a href="/pages/6Nle1uMltWSb2uh6hgTQ#fix">solution</a> to the described <a href="/pages/LxHtOb8sW6C9DrVZpyJ2">problem</a> by returning the <a href="/pages/bM02xNqvdJvIfZJuzFc6"><code>#fix</code></a> property of a specified object</p>                                                                                                                               |                                                                                                                                                                                                                                                                                                                                                                                   |
| <p><strong>public get</strong> <a href="/pages/vXJtO6FJrof8aEObMAcU"><strong>id()</strong></a><strong>:</strong> <mark style="color:green;">Id</mark>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                | <mark style="color:green;">undefined</mark><br>The <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get"><code>get</code></a> accessor gets the error <a href="/pages/6Nle1uMltWSb2uh6hgTQ#identification">identification</a> by returning the <a href="/pages/sM1pw7PS84C8cmqys4wZ"><code>#id</code></a> property of a specified object.</p> |
| <p><strong>public get</strong> <a href="/pages/GQRdEFvOHDqfnGJ51NkB"><strong>link()</strong></a><strong>:</strong> <mark style="color:green;">string</mark>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          | <mark style="color:green;">undefined</mark><br>The <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get"><code>get</code></a> accessor gets the link(to read more about the thrown error) by returning the <a href="/pages/T7CzWe5vgWUYvAmOLUPa"><code>#link</code></a> property of a specified object.</p>                                   |
| <p><strong>public get</strong> <a href="/pages/UAsNmVmOuYGxNypELFFh"><strong>message()</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 gets the error <a href="/pages/6Nle1uMltWSb2uh6hgTQ#message">message</a> by returning the parent <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/message"><code>message</code></a> property of the <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error"><code>Error</code></a> object.</p> |                                                                                                                                                                                                                                                                                                                                                                                   |
| <p><strong>public get</strong> <a href="/pages/LxHtOb8sW6C9DrVZpyJ2"><strong>problem()</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 gets the <a href="/pages/6Nle1uMltWSb2uh6hgTQ#problem">problem</a> by returning the <a href="/pages/ni1YTHvL07t1jeocuGux"><code>#problem</code></a> property of a specified object.</p>                                                                                                                                                                                                |                                                                                                                                                                                                                                                                                                                                                                                   |
| <p><strong>public get</strong> <a href="/pages/GF0yfhKsp9WzRTAHqFDt"><strong>template()</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 gets the <a href="/pages/6Nle1uMltWSb2uh6hgTQ#template">template</a> of the error message by returning the <a href="/pages/VT4SwlV0NwAnpvm5q6hg"><code>#template</code></a> property of a specified object.</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>, <code>{link}</code>, <a href="/pages/BbVb9Mj2Y9veAqrtKz61#max"><code>{max}</code></a>, <a href="/pages/BbVb9Mj2Y9veAqrtKz61#min"><code>{min}</code></a>, <a href="/pages/BbVb9Mj2Y9veAqrtKz61#type"><code>{type}</code></a> tags.</p>                                                                  |
| <p><a href="/pages/bM02xNqvdJvIfZJuzFc6"><strong>#fix</strong></a><strong>:</strong> <mark style="color:green;">string</mark><br>A privately stored possible solution to the described <a href="/pages/6Nle1uMltWSb2uh6hgTQ#problem">problem</a> of a <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String"><code>string</code></a> type.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| <p><a href="/pages/sM1pw7PS84C8cmqys4wZ"><strong>#id?</strong></a><strong>:</strong> <mark style="color:green;">Id</mark><br>A privately stored unique <a href="/pages/6Nle1uMltWSb2uh6hgTQ#identification">identification</a> of the described <a href="/pages/6Nle1uMltWSb2uh6hgTQ#problem">problem</a> of generic type variable <a href="/pages/PY4nixy9omXSectfeNl5#wrap-opening"><code>Id</code></a>.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| <p><a href="/pages/T7CzWe5vgWUYvAmOLUPa"><strong>#link?</strong></a><strong>:</strong> <mark style="color:green;">string</mark><br>The optional privately stored link of <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String"><code>string</code></a> type redirects to read more about the thrown error.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| <p><a href="/pages/ni1YTHvL07t1jeocuGux"><strong>#problem</strong></a><strong>:</strong> <mark style="color:green;">string</mark><br>A privately stored <a href="/pages/6Nle1uMltWSb2uh6hgTQ#problem">problem</a> of a <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String"><code>string</code></a> type.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| <p><a href="/pages/VT4SwlV0NwAnpvm5q6hg"><strong>#template</strong></a><strong>:</strong> <mark style="color:green;">string</mark><br>A <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string-type</a> privately stored <a href="/pages/6Nle1uMltWSb2uh6hgTQ#template">template</a> of the error <a href="/pages/6Nle1uMltWSb2uh6hgTQ#message">message</a> that contains replaceable required <a href="/pages/BbVb9Mj2Y9veAqrtKz61#fix"><code>{fix}</code></a>, <a href="/pages/BbVb9Mj2Y9veAqrtKz61#problem"><code>{problem}</code></a> and optional <a href="/pages/BbVb9Mj2Y9veAqrtKz61#id"><code>{id}</code></a>, <a href="/pages/BbVb9Mj2Y9veAqrtKz61#max"><code>{max}</code></a>, <a href="/pages/BbVb9Mj2Y9veAqrtKz61#min"><code>{min}</code></a>, <a href="/pages/BbVb9Mj2Y9veAqrtKz61#type"><code>{type}</code></a> tags.</p> |

### Methods

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| <p><strong>protected static</strong> <a href="/pages/KhI7uCqLCibWKkF1fp1b"><strong>defineMessage()</strong></a><strong>:</strong> <mark style="color:green;">string</mark><br>The static "<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals">tag</a>" method builds from the given <a href="/pages/KhI7uCqLCibWKkF1fp1b#...values-any"><code>values</code></a> the error message of a <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String"><code>string</code></a> type on the template.</p> |
| <p><strong>protected static</strong> <a href="/pages/EVnsL3y0PxCd21o8K9N0"><strong>isError()</strong></a><strong>: value is</strong> <mark style="color:green;">CommonError</mark><<mark style="color:green;">Id</mark>><br>Checks whether the <a href="/pages/EVnsL3y0PxCd21o8K9N0#value-any"><code>value</code></a> of any type is a <code>this</code> instance of any or the given <a href="/pages/EVnsL3y0PxCd21o8K9N0#id-id">identification</a>.</p>                                                                                                                            |
