# Overview

## `CommonErrors {}`

The `CommonErrors` object represents the storage of errors with [unique identification](https://error.angular-package.dev/draft-5/getting-started/basic-concepts#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="accessors/get-errors"><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="properties/errors"><code>#errors</code></a> property of a specified object.</p> |

### Properties

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p><strong>public static</strong> <a href="properties/static-template"><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="properties/id"><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="../../getting-started/basic-concepts#unique-identification">identification</a> numbers of generic type variable <a href="../generic-type-variables#commonerrors-less-than-id-greater-than"><code>Id</code></a>.</p>                                                                                                   |
| <p><a href="properties/errors"><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="../generic-type-variables#commonerrors-less-than-id-greater-than"><code>Id</code></a>.</p> |

### Methods

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