---
title: Error Handling
type: guide
summary: Error handling with SWR.
---

# Error Handling



<iframe
  src="https://codesandbox.io/embed/swr-states-7njdkp?codemirror=1&fontsize=14&theme=dark&autoresize=1&hidenavigation=1"
  style={{
  width: '100%',
  height: '100%',
  border: 0,
  overflow: 'hidden',
  background: 'rgb(21, 21, 21)'
}}
  title="SWR - Error Handling"
  allow="accelerometer; ambient-light-sensor; camera; encrypted-media; geolocation; gyroscope; hid; microphone; midi; payment; usb; vr; xr-spatial-tracking"
  sandbox="allow-autoplay allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
/>


---

For a semantic overview of all documentation, see [/sitemap.md](/sitemap.md)

For an index of all available documentation, see [/llms.txt](/llms.txt)

For agent-facing discovery, including API and MCP surfaces, see [/agents.md](/agents.md)