# Overview

## `ValidationError {}`

The `ValidationError` object is an extension of the [`CommonError`](https://docs.angular-package.dev/error/commonerror) class and is thrown when an operation could not be performed despite proper type(but not exclusively) with the [message](https://docs.angular-package.dev/error/commonerror/accessors/get-message) built from the described problem and its solution, along with additional identification on the given or stored template.

{% embed url="<https://github.com/angular-package/error/blob/main/src/lib/validation-error.class.ts>" %}
`validation-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;"><strong>string</strong></mark><br>The <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get"><code>get</code></a> accessor obtains 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 <code>'ValidationError'</code> 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://docs.angular-package.dev/error/validationerror)</strong></a><strong>: </strong><mark style="color:green;"><strong>string</strong></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>'ValidationError'</code> for an instance of <a href=""><code>ValidationError</code></a>.</p> |

### Methods

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p><strong>public static</strong> <a href="methods/static-define"><strong>define()</strong></a><strong>: </strong><mark style="color:green;"><strong>ValidationError</strong></mark><strong><</strong><mark style="color:green;"><strong>Id</strong></mark><strong>></strong><br>Defines the <a href=""><code>ValidationError</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 supplied or stored <a href="../methods/static-define#template-validationerror.template"><code>template</code></a>.</p> |
| <p><strong>public static</strong> <a href="methods/static-isvalidationerror"><strong>isValidationError()</strong></a><strong>: value is </strong><mark style="color:green;"><strong>ValidationError</strong></mark><strong><</strong><mark style="color:green;"><strong>Id</strong></mark><strong>></strong><br>Checks whether the <a href="../methods/static-isvalidationerror#value-any"><code>value</code></a> of any type is the <a href=""><code>ValidationError</code></a> instance of any or the given <a href="../methods/static-isvalidationerror#id-id">identification</a>.</p>                                                                                                                                                                                                                |
