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.
-
Drag the action whose response you want to modify to the PENDING OVERRIDES
section.
-
Select Error Response Next Time in the drop-down list.
-
Add an Error Message.
-
Add some text in the Error Stack
field.
-
Click Save.
-
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.
-
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").