BookatlasTwo-Day MuleSoft → Salesforce Bootcamp
4 / 18 · Module 7 — Error Handling in Mule · filtered: cheatsheet← prev⊞ allnext →

7.11Normalize errors into your API contract

Bad response:

{
  "error": "SALESFORCE:INVALID_INPUT",
  "description": "INVALID_FIELD_FOR_INSERT_UPDATE..."
}

Better:

{
  "code": "INVALID_CUSTOMER",
  "message": "Customer could not be processed.",
  "correlationId": "abc-123"
}

Internally you log enough diagnostic detail.

Externally you expose your API contract.

Same principle we used with successful responses:

Salesforce contract
≠
public API contract