Custom error handlers
Besides customizing the error page, you can also customize how all errors are handled and override the default system behavior.
For example, the default βPage Not Foundβ
error would navigate to the /error
page but if you would rather show a toaster alert, the following could be added to the App
model.
As it can be seen above, custom behaviours are added under a reserved global actions key errorHandlers
, and that will be an array of objects. Each object having have codes
and actions
.
codes
array
of error codes that the associated actions will run with.
actions
array of actions
The result from the example code above is the alert shown below.
code
actions.options.error.code
description
actions.options.error.description
message
actions.options.error.message
Last updated
Was this helpful?