Not Found Page
Next.js provides several built-in error pages. If a page route doesn’t exist, the Not Found page is rendered. Customize it by editing the filesrc/app/not-found.tsx


Global Error Page
To create a global error page for all errors, you can use theglobal-error.tsx
file.
Customize it by editing the file src/app/global-error.tsx


You can find more infos about the error pages in the official
documentation
from Next.js