Routing: Error Handling | Next.js
nextjs.org · 1,303 words · saved by 2 readers
Handle runtime errors by automatically wrapping route segments and their nested children in a React Error Boundary.
This page is also available as Markdown at /docs/app/getting-started/error-handling.md . For an index of Next.js documentation , see /docs/llms.txt . Copy page Error Handling Last updated March 25, 2026 Errors can be divided into two categories: expected errors and uncaught exceptions . This page will walk you through how you can handle these errors in your Next.js application. Handling expected errors Expected errors are those that can occur during the normal operation of the application, such as those from server-side form validation or failed requests. These errors should be handled explici
saved by
related reading
- File-system conventions: loading.js | Next.jsnextjs.org
- Getting Started: Fetching Data | Next.jsnextjs.org
- Getting Started: Fetching Data | Next.jsnextjs.org
- Getting Started: Layouts and Pages | Next.jsnextjs.org
- Getting Started: Caching | Next.jsnextjs.org
- API Reference: Edge Runtime | Next.jsnextjs.org
- Error Boundaries in React - Handling Errors Gracefully | Refinerefine.dev
- How Notion pulled itself back from the brink of failure | Figma Blogfigma.com
- Guides: Forms | Next.jsnextjs.org
- LessWronglesswrong.com
- How Mozilla’s Rust dramatically improved our server-side performance | Figma Blogfigma.com
- Getting Started: Mutating Data | Next.jsnextjs.org