How On Error Propagate works in Mule 4?

What is On Error Propagate in Mule 4?


Executes but propagates the error to a higher level, such as a containing scope (for example, to a Flow that contains a Try scope where the error occurs) or external flow containing a Flow Reference to the flow in which an error occurs. The error breaks the owner’s execution and propagates to that higher level, causing a failure at that level. In addition, any transaction the owner handles is rolled back. However, note that the transaction is not rolled back if another component (one that does not own On Error Propagate) created the transaction Source




How On Error Propagate works in Mule 4?


Scenario: Assume a similar scenario that we used to explain the On Error Continue component. Here an error is thrown by Is number component. This is because the payload which we sent does not satisfy the criteria of Is number ( payload should be an Integer)



How it is working?



Response:

We can observe that the client receives the error message that was created by Is number component but not the message of On Error Propagate. We can also note that the Status code was 500 Server Error.


 

Now let us see what happens to the flow if we use On Error Continue in place of On Error Propagate in the same flow.

 

Post a Comment

0 Comments