BookatlasTwo-Day MuleSoft → Salesforce Bootcamp
233 / 1048 · Module 7 — Error Handling in Mule← prev⊞ allnext →

7.12Example error handler

Conceptually:

<error-handler>

    <on-error-continue
        type="VALIDATION:*">

        <set-variable
            variableName="httpStatus"
            value="400"/>

        <set-payload value="#[{
            code: 'INVALID_REQUEST',
            message: error.description
        }]"/>

    </on-error-continue>

    <on-error-propagate
        type="SALESFORCE:CONNECTIVITY">

        <logger
            level="ERROR"
            message="Salesforce connectivity failure"/>

    </on-error-propagate>

</error-handler>

Exact production XML will vary.

The architecture is what matters.