# Error Handling

The **Error Event** is used to handle **exceptions or runtime errors** that occur during the execution of a task in a Microflow or Process Flow.\
It allows the flow to react gracefully to failures by executing **alternative logic**, such as logging errors, sending notifications, or triggering recovery actions.

<figure><img src="https://2015371994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMpDjHWFRUtZ5nJcSfVXd%2Fuploads%2FTPzjFhaY9ONYkpkJ3XCR%2F0?alt=media" alt=""><figcaption></figcaption></figure>

***

### Purpose

**Error Events** are designed to:

* Capture and handle exceptions thrown during task execution
* Prevent abrupt termination of a flow
* Enable controlled error recovery or escalation logic

For example:

* If a **Java Task** throws an exception
* Or a **Web Service Task** fails during execution

An **Error Event** can be attached to handle the error by:

* Sending an error message or notification
* Logging error details
* Redirecting the flow to an alternate path

This makes Error Handling a critical component for building **robust and production‑ready integrations**.

***

### Error Event as a Boundary Event

The Error Event is commonly used as a **Boundary Event**, attached to an Activity Node.

Behavior:

* The main task begins execution
* If an exception occurs within the task
* The Error Event is triggered
* The flow transitions to an error‑handling path

When an Error Event is triggered, the normal execution of the attached task is interrupted.

***

### Error Event Configuration

The **Error Configuration Panel** contains a single tab for defining error handling behavior.

***

#### Error Tab

<figure><img src="https://2015371994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMpDjHWFRUtZ5nJcSfVXd%2Fuploads%2Fn4UAJgW4NNSmo421q0UU%2F1?alt=media" alt=""><figcaption></figcaption></figure>

| Property      | Mandatory | Default | Description                                                        |
| ------------- | --------- | ------- | ------------------------------------------------------------------ |
| **Exception** | Yes       | —       | Specifies the type of exception that the Error Event should handle |

***

### Managing Exceptions

Within the **Error** tab, users can manage exception handling rules using the following actions:

* **Add Exception Row**\
  Add additional exception types to be handled by the Error Event.
* **Delete**\
  Remove an existing exception configuration.

Multiple exception types can be associated with a single Error Event, allowing flexible and comprehensive error handling.

***

### Mapping Parameters for Error Handling

The **Open Mapping Parameter** button allows users to map data related to the exception.

When clicked:

1. The system navigates to the **Mapping Parameter Screen**
2. Users can configure:
   * **Mapping Parameter Input** – pass data into the error‑handling path
   * **Mapping Parameter Output** – capture error information for downstream logic

This enables:

* Detailed error reporting
* Conditional error handling based on exception data
* Propagating error context to other nodes

***

### Best Practices for Error Handling

* Always handle expected failure points (external services, databases, Java logic)
* Combine **Error Events** with **Timer Events** for robust timeout handling
* Avoid swallowing errors silently; log or notify appropriately
* Use descriptive exception mapping to improve troubleshooting
* Keep error‑handling logic clear and isolated

***

### Summary

The **Error Handling** mechanism in ONEWEB allows flows to respond predictably and safely to runtime failures.

By using **Error Events**, developers can:

* Detect and capture execution errors
* Prevent uncontrolled flow termination
* Execute recovery or escalation logic
* Improve reliability of integration workflows

Error Handling is essential for building **fault‑tolerant, enterprise‑grade integrations** in ONEWEB, especially when working with external systems and custom logic.


---

# 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/designer-reference/microflow-designer/activity-nodes/error-handling.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.
