Search code examples
mulemule-componentmulesoftmule-esbmule-el

How to differentiate error from 2 until-successful component in a single mule flow?


I am using mule version 3.9.

I am having a mule flow in which i am making 2 http calls to different URLs. First one is a retrieve call and then do some transformation and then i am calling the update api. I have put both API calls in individual until-successful components. I am using synchronous method.

In error handling part, i like to log which Api call was failed? Both http calls will throw same error "org.mule.module.http.internal.request.ResponseValidatorException". I am not able to get url path info in the "exception.info" expression. Is there any other way to differentiate between these 2 http calls in error handling?


Solution

  • The until-successful scope consumes the error by design. To see them, move the requests each to a separate new flow (not a subflow), and use a flow reference inside the until-successful. The new flows have to be synchronous too. Flows have their own exception handling so they will log the error.

    Reference: https://help.mulesoft.com/s/article/How-to-log-the-exception-thrown-inside-until-successful-scope