> For the complete documentation index, see [llms.txt](https://docs.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://docs.angular-package.dev/error/commonerrors/overview.md).

# Overview

The \`CommonErrors\` object

## `CommonErrors {}`

The `CommonErrors` object represents the storage of errors with [unique identification](/error/getting-started/basic-concepts.md#unique-identification) numbers.

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

### **Accessors**

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p><strong>protected get</strong> <a href="/error/commonerrors/accessors/get-errors.md"><strong>errors()</strong></a><strong>:</strong> <mark style="color:green;">Map</mark><<mark style="color:green;">Id</mark>, <mark style="color:green;">any</mark>><br>The <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get"><code>get</code></a> accessor returns the errors of <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map"><code>Map</code></a> type by returning the <a href="/error/commonerrors/properties/errors.md"><code>#errors</code></a> property of a specified object.</p> |

### Properties

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p><strong>public static</strong> <a href="/error/commonerrors/properties/static-template.md"><strong>template?</strong></a><strong>:</strong> <mark style="color:green;">string</mark></p><p>Optional template of <a href="https://www.typescriptlang.org/docs/handbook/basic-types.html#string"><code>string</code></a> type.</p>                                                                                                                                                                                                                              |
| <p><a href="/error/commonerrors/properties/id.md"><strong>#id?</strong></a><strong>:</strong> <mark style="color:green;">Set</mark><<mark style="color:green;">Id</mark>><br>The collection of unique allowed <a href="/error/getting-started/basic-concepts.md#unique-identification">identification</a> numbers of generic type variable <a href="/error/commonerrors/generic-type-variables.md#commonerrors-less-than-id-greater-than"><code>Id</code></a>.</p>                                                                                               |
| <p><a href="/error/commonerrors/properties/errors.md"><strong>#errors</strong></a><strong>:</strong> <mark style="color:green;">Map</mark><<mark style="color:green;">Id</mark>, <mark style="color:green;">any</mark>><br>The errors storage of the <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map"><code>Map</code></a> type where the <code>key</code> is of the generic type variable <a href="/error/commonerrors/generic-type-variables.md#commonerrors-less-than-id-greater-than"><code>Id</code></a>.</p> |

### Methods

|                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p><strong>public</strong> <a href="/error/commonerrors/methods/delete.md"><strong>delete()</strong></a><strong>:</strong> <mark style="color:green;">this</mark></p><p>Deletes the error of a specified <a href="/error/commonerrors/methods/delete.md#id-errorid"><code>id</code></a> from the object.</p>                                                                                                                                         |
| <p><strong>public</strong> <a href="/error/commonerrors/methods/has.md"><strong>has()</strong></a><strong>:</strong> <mark style="color:green;">boolean</mark><br>The <code>has()</code> method checks whether the error of the given <a href="/error/commonerrors/methods/has.md#id-errorid"><code>id</code></a> exists in a specified object.</p>                                                                                                  |
| <p><strong>public</strong> <a href="/error/commonerrors/methods/throw.md"><strong>throw()</strong></a><strong>:</strong> <mark style="color:green;">void</mark><br>Throws an error of the given <a href="/error/commonerrors/methods/throw.md#id-errorid"><code>id</code></a> if the unique <a href="/pages/mb13waFtHVZxVvkUgUwQ#...id-id"><code>id</code></a> was provided in the <a href="/error/commonerrors/constructor.md">constructor</a>.</p> |
| <p><strong>protected</strong> <a href="/error/commonerrors/methods/isallowedid.md"><strong>isAllowedId()</strong></a><strong>:</strong> <mark style="color:green;">boolean</mark><br>Checks whether the given <a href="/error/getting-started/basic-concepts.md#unique-identification">identification</a> number was provided in the <a href="/error/commonerrors/constructor.md">constructor</a>.</p>                                               |
