BookatlasTwo-Day MuleSoft → Salesforce Bootcamp
258 / 278 · Module 18 — Interview Coding Scenarios · filtered: code← prev⊞ allnext →

18.16Scenario 15 — On Error Continue

Prompt:

“Loyalty service is optional. If it fails, return null.”

Conceptually:

<try>

    <http:request
        config-ref="Loyalty_API"
        path="/customers/#{vars.customerId}"/>

    <error-handler>

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

            <set-variable
                variableName="loyalty"
                value="#[null]"/>

        </on-error-continue>

    </error-handler>

</try>

Exact HTTP:* matching syntax/configuration can vary, but architecture is:

Try
 ↓
optional call
 ↓
On Error Continue
 ↓
recover