# Error Event

The **Error Event** is used to handle **exceptions or runtime errors** that occur during the execution of an activity within a business process.\
It allows the process to **react gracefully to failures** by triggering alternative actions instead of abruptly stopping execution.

In the Process Template Diagram, an Error Event is represented by an **error icon**, as shown below.

<figure><img src="https://2015371994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMpDjHWFRUtZ5nJcSfVXd%2Fuploads%2FU2PEasRKXwPJM9VXbcWh%2Fimage.png?alt=media&#x26;token=c33c3335-c3d9-41e0-b515-e5a2b8d9360d" alt=""><figcaption></figcaption></figure>

***

### Purpose

**Error Events** are designed to handle **unexpected failures** or **business/system exceptions** during process execution.

They can be used to:

* Capture errors thrown by activities (e.g. Java Task, Web Service Task, Database Task)
* Trigger alternative flows such as error handling or notification
* Prevent the entire process from terminating due to a single failure
* Provide controlled recovery or escalation mechanisms

#### Example scenario

* A **Java Task** fails due to an exception
* An **Error Boundary Event** attached to the task is triggered
* The process automatically executes an error‑handling path, such as:
  * Logging the error
  * Sending a notification
  * Invoking a compensation or cleanup task

***

### Error Event as a Boundary Event

The Error Event is commonly used as a **Boundary Event**, meaning:

* It is **attached to an activity node**
* It is triggered only when an exception occurs within that activity
* It redirects execution to an **alternative error‑handling path**

This allows exception logic to be defined **locally at the activity level**, instead of globally across the process.

***

### Error Event Configuration Overview

The Error Event configuration panel contains **one main tab**:

1. **Error**

***

### Error Tab

The **Error** tab is used to define which exceptions should be handled by this Error Event.

<figure><img src="https://2015371994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMpDjHWFRUtZ5nJcSfVXd%2Fuploads%2F78AHG2T9ywt5YUUxz4Fg%2Fimage.png?alt=media&#x26;token=e24a9a27-df41-48a3-9446-96e980023b99" alt=""><figcaption></figcaption></figure>

#### Error Properties

| Property  | Mandatory | Description                                         |
| --------- | --------- | --------------------------------------------------- |
| Exception | Yes       | Type of exception that this Error Event will handle |

***

### Managing Exceptions

Within the **Error** tab, users can:

* Click **Add Exception Row** to define additional exceptions
* Click **Delete** to remove an existing exception
* Configure multiple exception types for a single Error Event

This allows fine‑grained control over which errors trigger specific handling logic.

***

### Mapping Parameters for Error Events

The **Open Mapping Parameter** button is used to map:

* Error details into process variables
* Exception data into Business Objects

When **Open Mapping Parameter** is clicked:

* The system navigates to the **Mapping Parameter** screen
* Users can map:
  * **Mapping Parameter Input**
  * **Mapping Parameter Output**

This makes exception information available for downstream error‑handling activities (e.g. logging, notifications, compensations).

***

### Usage Guidelines

* Attach Error Events to activities that may throw runtime exceptions
* Clearly define which exceptions should be handled
* Avoid catching overly generic exceptions unless necessary
* Always design a clear error‑handling path to prevent dead‑ends
* Use Business Object mapping to pass meaningful error information

***

### Summary

The **Error Event** enables structured and controlled **exception handling** in ONEWEB Process Designer.

Key points:

* Handles runtime errors during task execution
* Commonly used as a Boundary Event
* Triggers alternative error‑handling flows
* Supports multiple exception definitions
* Enables data mapping for error context

Proper use of Error Events ensures that business processes are **robust, fault‑tolerant, and production‑ready**, even when unexpected failures occur.


---

# Agent Instructions: 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.onewebstack.com/oneweb-platform-th/designer-reference/process-designer/process-designer-component/boundary-events/error-event.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.
