# Error pages

## Errors handling

When an error occurs on a page, the error is intercepted by an error route.

The page is defined by `src/app/error.tsx` and it renders the component `<PageError />`

<figure><img src="https://3985976695-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FT3t4pDs63s3Soj1JetJw%2Fuploads%2FDUOcd8F186W2DbGov052%2Fimage.png?alt=media&#x26;token=e323182f-a0fe-4a11-8a71-e720c3fe37d2" alt=""><figcaption><p>PageError component</p></figcaption></figure>

You can define specific error pages by adding an `error.tsx` file to a nested route, for instance inside the folder `src/app/dashboard/`

## Not Found

<figure><img src="https://3985976695-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FT3t4pDs63s3Soj1JetJw%2Fuploads%2FcfVddgL0uuHZd66KM4td%2Fimage.png?alt=media&#x26;token=59a4a333-6cc2-4fba-8ad5-83d4129c3db8" alt=""><figcaption></figcaption></figure>

If a page route doesn't exist, the Not Found page is rendered.

Customize it by editing the file `src/app/not-found.tsx`

{% hint style="info" %}
Learn more about [Next.js Error Handling](https://nextjs.org/docs/app/building-your-application/routing/error-handling)
{% endhint %}
