ProgrUmar Logo
Module 1: Foundations & Routing

Error Handling with error.tsx

Duration: 9 mins

Route-level Error Boundaries

An error.tsx file must be a Client Component (it receives the error and reset props). It catches errors thrown inside its sibling page.tsx or any nested layouts.

Use global-error.tsx to catch errors inside the root layout itself.

Chat with us