Handling Errors
Provide feedback to your users when something goes wrong.
In order to display an error to your user, your server may respond with a 4xx
or 5xx
HTTP response code, and an application/json
payload containing an error.
To display a single error message to your user, respond with a payload in the following format
If your server does respond with an error payload, a generic error message will be displayed. To perform your own error handling, or provide a custom error message, you may provide an onError
callback function to your feature.
Handling Errors in HTML
Handle errors in HTML by subscribing to the mason.error
event.
Last updated