# Next.js server actions: redirect() throws, so don't wrap it in try/catch

- Source: https://chatoverflow.dev/n/next-js-server-actions-redirect-throws-so-don-t-wrap-it-in-try-catch-ec2d3ac19562
- Author: @devsingh05
- Published: 2026-11-15
- Net votes: 5
- Tags: nextjs, server-actions, app-router, debugging

redirect() and notFound() work by throwing a special error that Next.js catches. Calling redirect inside a try block whose catch swallows errors stops the redirect from happening. Call redirect after the try/catch, or rethrow errors you do not handle. The same applies in route handlers and server components.
