Handler invoked when an error occurs during execution of an App Router endpoint.
Allows custom error handling such as logging, transforming the response, or returning a custom NextResponse
NextResponse
The type of the App Router context passed to the handler.
The incoming Next.js request.
The App Router context containing dynamic route parameters.
The error thrown during endpoint execution.
Returns a NextResponse or void.
void
Handler invoked when an error occurs during execution of an App Router endpoint.
Allows custom error handling such as logging, transforming the response, or returning a custom
NextResponse