Printing Mule Error message with Dataweave Selector Expressions
As you all know the importance of Error Handling in Application development, the better the error is handled the better the application works. There are many changes seen in the Error handler of Mule 4 when compared to the Error handler in Mule 3 and lower versions.
On Error Propagate, On Error Continue, and Try component was introduced in Mule 4.x versions. This made error handling simple and easy to incorporate.
Let us see the Dataweave 2.0 expressions that can be used when building the error handler for your project. See how can we access the detailed error message in Mule 4 with Dataweave selector expression for errors
#[error.description]
- The description of the issue
#[error.detailedDescription]
- A detailed description that can be similar to the description or provides a better explanation.
#[error.errorType]
- This is used to categorize the error which is used to select the error-handling component to be called.
#[error.cause]
- The underlying Java Throwable that resulted in the failure
#[error.errorMessage]
- An optional Mule message about the problem.
#[error.childErrors]
- An optional collection of inner errors
Also Read: Simple use of filter, contains in Dataweave 2.0 on JSON message
0 Comments