Set an Error Response

Your app should degrade gracefully when an error occurs so that users understand what happened or know how to proceed. Use the Salesforce Lightning Inspector to simulate an error condition and see how the user experience is affected.
  1. Drag the action whose response you want to modify to the PENDING OVERRIDES section.
  2. Select Error Response Next Time in the drop-down list.
  3. Add an Error Message.
  4. Add some text in the Error Stack field.Error response
  5. Click Save.
  6. To trigger execution of the action, refresh the page.
    • The modified action response moves from the PENDING OVERRIDES section to the PROCESSED OVERRIDES section.
    • The action response displays in the COMPLETED section in the left panel with a State equals ERROR.Error response completed
  7. Note the UI change, if any, related to your change. The UI should handle errors by alerting the user or allowing them to continue using the app.
    To degrade gracefully, make sure that your action response callback handles an error response (response.getState() === "ERROR").