> 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

Error pages can be divided into business errors and platform errors.

### Platform errors

Platform errors are errors that appear when an error occurs on the application that is handled by default in the platform, e.g. a session expiration error.

In the above situation, an error page is displayed containing textContent set in the platform configuration **errorPagesConfiguration**

{% hint style="info" %}
The configuration is set centrally in the platform. We do not have the ability to update it low-code in the designer. If changes are needed, contact the administrators.
{% endhint %}

\
**Sample 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>
```

### Business errors

**Business error** is a situation in which a user's action, a system process, or interaction with an external system violates the adopted business rules - even though, from a technical point of view, the operation could be performed.

Examples:

* Attempting to withdraw an amount exceeding the available funds.
* Submitting an application with an inactive customer account.
* Accessing the application as an unauthenticated user, even though login is required

#### How to trigger?

**Business error** can be triggered in script services and script validators. The best way to do this is to use the method **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" %}
In the context object, do not call the method `build()`
{% endhint %}

{% hint style="info" %}
A good practice is to use the method `.msg` when triggering a business error. A clear business message should be passed there - e.g. `.msg("Application unavailable")`. The defined message will be written to the logs, which makes analysis and error identification easier.
{% endhint %}

Example script with descriptions:

```javascript
function callService(context) {
    let option = context.getFirstParameter('option');
 
    if (!option) {
        return []
    }
 
    let builder = context.getErrorPageDefinitionBuilder() // The method prepares the error screen to be displayed
 
    switch (option) {
        case "1": // Error screen that shows the Content artifact 'error_page_default'
            builder.bodyTextContent("error_page_default-*")
            builder.msg("Application unavailable") // Error message that will be written to 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("Application unavailable")
            break;
        case "3": // Error screen that shows the Content artifact 'error_page_noAuthorization'
            builder.bodyTextContent("error_page_noAuthorization-*")
            builder.pageTitle("Page title")
            builder.logobarTitle("Logo title")
            builder.retryButtonAvailable(true);
            builder.msg("Application unavailable")
            break;
        default: // Default error screen displayed as a result of an error in the script
            throw "Script exception"
 
    }
    context.throwBusinessException(builder); // Throwing 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
