# Vercel Authors - Error Handling – SWR (Highlights)

## Metadata
**Cover**:: https://readwise-assets.s3.amazonaws.com/static/images/article3.5c705a01b476.png
**Source**:: #from/readwise
**Zettel**:: #zettel/fleeting
**Status**:: #x
**Authors**:: [[Vercel Authors]]
**Full Title**:: Error Handling – SWR
**Category**:: #articles #readwise/articles
**Category Icon**:: 📰
**URL**:: [swr.vercel.app](https://swr.vercel.app/docs/error-handling)
**Host**:: [[swr.vercel.app]]
**Highlighted**:: [[2022-04-22]]
**Created**:: [[2022-09-26]]
## Highlights
- You can always get the error object inside the component reactively.
But in case you want to handle the error globally, to notify the UI to show a toast or a snackbar, or report it somewhere such as Sentry,
there's an onError event
```jsx
<SWRConfig value={{
onError: (error, key) => {
if (error.status !== 403 && error.status !== 404) {
// We can send the error to Sentry,
// or show a notification UI.
}
}
}}>
<MyApp />
</SWRConfig>
```