> 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/commonerror/properties/static-template.md).

# static template

## `CommonError.template`

A template of the error message of [`string`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) type with the replaceable [`{problem}`](/error/commonerror/constructor.md#problem), [`{fix}`](/error/commonerror/constructor.md#fix) and optional [`{id}`](#id), [`{link}`](#link), [`{max}`](#max), [`{min}`](#min), [`{type}`](#type) tags.

{% hint style="info" %}
By default, it's set to:

`Problem{id}: {problem} => Fix: {fix}`.
{% endhint %}

{% code title="common-error.class.ts" %}

```typescript
public static template = `Problem{id}: {problem} => Fix: {fix}`;
```

{% endcode %}

### Tags

Replaceable tags on the [`template`](#template-string-commonerror.template).

#### `{fix}`

Replaceable by the given required [`fix`](/error/commonerror/constructor.md#fix-string) parameter.

#### `{id}`

Replaceable by the given [`id`](/error/commonerror/constructor.md#id-id) parameter.

#### `{link}`

Replaceable by the property `link` of the given [`additional`](/error/commonerror/constructor.md#additional-min-number-max-number-type-string) parameter.

#### `{max}`

Replaceable by the property `max` of the given [`additional`](/error/commonerror/constructor.md#additional-min-number-max-number-type-string) parameter.

#### `{min}`

Replaceable by the property `min` of the given [`additional`](/error/commonerror/constructor.md#additional-min-number-max-number-type-string) parameter.

#### `{problem}`

Replaceable by the given required [`problem`](/error/commonerror/constructor.md#problem-string) parameter.

#### `{type}`

Replaceable by the property `type` of the given [`additional`](/error/commonerror/constructor.md#additional-min-number-max-number-type-string) parameter.

## Example usage

```typescript
// Example usage.
import { CommonError } from '@angular-package/error';

// Change the template.
CommonError.template = `Problem({id}): {problem} => Fix: {fix}`;

// Extend the `CommonError` class.
class TestError<Id extends string> extends CommonError<Id> {}

// Returns
// Error: Problem(AE:427): The `age` parameter is wrong. => Fix: Provided `age`
// must be different type.
new TestError(
  'The `age` parameter is wrong.', // Problem
  'Provided `age` must be different type. ', // Fix
  'AE:427' // Identification
);
```


---

# 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://docs.angular-package.dev/error/commonerror/properties/static-template.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.
