Introduction
This article is the continued part in the MuleSoft articles series; if you would like to understand the basics of MuleSoft, refer to these articles before going next,
- Getting Started MuleSoft
- How To Connect to Azure SQL Database with MuleSoft
- Load Data from S3 Bucket Using MuleSoft S3 Connector
- How To Call Stored Procedure with MuleSoft
- How To Post Data Using Stored Procedure with MuleSoft
- How To Set Variable and Payload in MuleSoft
- Fetch MySQL Data Using Database Connector in MuleSoft
- Retrieve Data From Database Based On Conditions In MuleSoft
- Create and Write CSV Files Using File Connector in MuleSoft
- Read Files Using File Connector in MuleSoft
- Default Error Handling Behavior of a Mule Application
Getting Started
In this article, we will discuss 2 types of error-handling mechanisms in Mule 4.
- On-Error-Continue: This feature allows you to instruct MuleSoft to continue processing even when an error occurs. With this approach, you can handle errors within a flow without interrupting the entire integration. It enables you to define alternative routes or fallback mechanisms to handle errors and maintain data integrity.
Executes and sends the result of the execution to its container Try scope, which uses that result to complete the execution successfully. Any transactions at this point are also committed.
- On-Error Propagate: MuleSoft allows you to propagate errors from one component to another within or between different flows. This enables you to centralize error-handling logic and avoid repetitive error-handling code across multiple components.
Rolls back any transactions, then executes and uses that result to re-throw the existing error, causing its container Try scope's execution to fail.
Let's do a quick project setup and include the required global config files
- First, open Anypoint Studio and Create a New Mule Project.
- Enter a project name and selection location and click finish.
- Click on Add Modules in the Mule palette and find File in the featured components.
- Drag and drop the File onto the Mule palette before adding it to the project.
- Now let's add a new Mule Configuration File and give the name as global.
- Enter the file name as global.
- Go to Global Elements, click the Create button, and add an HTTP Listener config.
- Leave everything as default and click ok.
- Click the Create button, Select File Config, and click OK.
- Provide the Working Directory path in the General tab.













Join the conversation! Your thoughts help the community grow.