error.js
is a file convention that lets you define fallback UI for a route segment to show when unexpected runtime errors occur.
When an error is thrown in a route segment or its children, the fallback UI from error.js
renders instead. The rest of the application remains interactive and the user can attempt to reset or recover from the error.
Use filesytem hierarchy to define more or less specific fallback UI.