> For the complete documentation index, see [llms.txt](https://docs.usegravity.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.usegravity.app/gravity-native/handling-errors.md).

# Handling Errors

There is a global error handler contained within the [**AppContext**](/gravity-native/app-context.md)**.** If you encounter an error in your application, you can handle it by passing it to the `handleError` method.

```javascript
context.handleError(err)
```

When an error is caught, it will be displayed to the user in a [notification banner](/gravity-native/components/notification.md) and the mobile device will vibrate.&#x20;

In the case of a `401` (unauthenticated) error, the user will be directed to sign in.
