# Vercel Authors - Error Handling – SWR (Highlights) ![rw-book-cover|256](https://readwise-assets.s3.amazonaws.com/static/images/article3.5c705a01b476.png) ## 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> ```