# Handling Errors

There is a global error handler contained within the [**AppContext**](https://docs.usegravity.app/gravity-native/app-context)**.** 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](https://docs.usegravity.app/gravity-native/components/notification) and the mobile device will vibrate.&#x20;

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