Gravity
Search…
Handling Errors
Errors are handled by the <View> component, which has a handleError method stored in the view context. You should always use a try...catch statement around any asynchronous code that may encounter an error. Inside your catch method, you can then call the view error handler and pass the error object.
1
try {
2
...
3
}
4
catch (err){
5
6
context.handleError(err);
7
8
}
Copied!
This will display a banner notification along the top of the view, with the error message text and also a console log.
Last modified 1yr ago
Copy link