> For the complete documentation index, see [llms.txt](https://docs.eximee.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.eximee.com/documentation/documentation-en/budowanie-aplikacji/interfejs-uzytkownika/formularze/tworzenie-formularza/strony-bledow.md).

# Error pages

We can divide error pages into business errors and platform errors.

### Platform errors

Platform errors occur when an error arises in an application that is handled by default by the platform, such as a session expiration error.

In the situation described above, an error page is displayed with the textContent configured on the platform **errorPagesConfiguration**

{% hint style="info" %}
This configuration is set centrally on the platform. It cannot be updated using low-code tools in the designer. If you need to make changes, contact the administrators.
{% endhint %}

\
**Example configuration:**

```xml
<code_default>
    <content>error_page_default-*</content>
</code_default>
<code_serverSessionExpired>
    <content>error_page_serverSessionExpired-*</content>
    <retryButtonAvailable>true</retryButtonAvailable>
    <styleName>spider-night</styleName>
</code_serverSessionExpired>
<code_formLimitExceeded>
    <content>error_page_formLimitExceeded-*</content>
</code_formLimitExceeded>
<code_businessKeyAlreadyExists>
    <content>error_page_businessKeyAlreadyExists-*</content>
</code_businessKeyAlreadyExists>
```

#### Refusal to start a case with another case's number

When a form starts a case with a number that is already assigned to another case, the platform displays the error page for the `businessKeyAlreadyExists`. This applies to the save point in **EximeeRouter2**, the `START_PROCESS_AND_RESUME` action, and the form's script service. The rule is described on the page [Case number uniqueness](https://docs.eximee.com/documentation/documentation-en/budowanie-aplikacji/proces-biznesowy/unikalnosc-numeru-sprawy.md).

* The page content comes from the artifact **Content** `error_page_businessKeyAlreadyExists`, referenced by the entry `code_businessKeyAlreadyExists` in the **errorPagesConfiguration**. To change the content, publish a new version of this artifact.
* Deployment without an entry `code_businessKeyAlreadyExists` displays the default error page (`code_default`).

### Business errors

**A business error** is a situation in which a user's action, a system process, or an interaction with an external system violates established business rules—even though the operation could technically be performed.

Examples:

* Attempting to withdraw an amount greater than the available balance.
* Submitting an application when the customer's account is inactive.
* Opening an application as a logged-out user, even though login is required

#### How do you trigger it?

**Business error** can be called in script services and script validators. The best method to use for this is **throwBusinessException** and **getErrorPageDefinitionBuilder**.

Methods that can be called on the context object:

```javascript
context.getErrorPageDefinitionBuilder()
.body(string)
.styleName(string);
.msg(string)
.pageTitle(string)
.pageTitleKey(string)
.sidebarSlot2TextContent(string);
.sidebarSlot2(string);
.sidebarSlot1TextContent(string);
.sidebarSlot1(string);
.retryButtonAvailable(string)
.retryButtonAvailable(boolean);
.logobarTitle(string);
.logobarTitleKey(string)
.logobarDescription(string);
.bodyTextContent(string);
.parameter(String key, String value)
.cause(Throwable cause)
.redirectUrl(string)
.redirectDelayInMillis(string)
.businessFormIdentifier(string)
```

{% hint style="danger" %}
Do not call the `build()`
{% endhint %}

{% hint style="info" %}
It is good practice to use the `.msg` method when throwing a business error. Pass a clear business message to it—for example, `.msg("Request unavailable")`. The defined message will be printed in the logs, making it easier to analyze and identify errors.
{% endhint %}

Example script with descriptions:

```javascript
function callService(context) {
    let option = context.getFirstParameter('option');
 
    if (!option) {
        return []
    }
 
    let builder = context.getErrorPageDefinitionBuilder() // This method prepares the error screen to be displayed
 
    switch (option) {
        case "1": // Error screen displaying the Content artifact 'error_page_default'
            builder.bodyTextContent("error_page_default-*")
            builder.msg("Request unavailable") // Error message that will be printed in the logs
            break;
        case "2": // Error screen added using the content provided in body
            builder.body("Default body in the object")
            builder.parameter("type", "info")
            builder.msg("Request unavailable")
            break;
        case "3": // Error screen displaying the Content artifact 'error_page_noAuthorization'
            builder.bodyTextContent("error_page_noAuthorization-*")
            builder.pageTitle("Page title")
            builder.logobarTitle("Logo title")
            builder.retryButtonAvailable(true);
            builder.msg("Request unavailable")
            break;
        default: // Default error screen displayed as a result of an error in the script
            throw "Script exception"
 
    }
    context.throwBusinessException(builder); // Throw an error screen with the prepared builder object
 
 
    return [{ 'output': '' }];
}

```


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.eximee.com/documentation/documentation-en/budowanie-aplikacji/interfejs-uzytkownika/formularze/tworzenie-formularza/strony-bledow.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
