The home page caught every fetch failure and rendered its empty state, so a backend outage looked like a site with no schools in it. School pages turned any error into notFound(), which told visitors — and crawlers — that a real school had ceased to exist. Place fetches did the same by returning [] and null. Failures now reach a retryable error boundary; only a genuine 404 still calls notFound(). "Load more" and the map fetch resolved against whatever state existed when they returned, so results from an abandoned search appended themselves to the new ones. Each fetch now carries an AbortController and checks that its search scope is still current before touching state. The map only records its cache key on success, so a failed load retries instead of pinning the stale marker set. Jest ignored .next/, whose build output otherwise shadowed real suites. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
13 lines
470 B
TypeScript
13 lines
470 B
TypeScript
'use client';
|
||
|
||
export default function ErrorPage({ reset }: { error: Error & { digest?: string }; reset: () => void }) {
|
||
return (
|
||
<main style={{ maxWidth: '48rem', margin: '4rem auto', padding: '1.5rem' }}>
|
||
<h1>We couldn’t load this page</h1>
|
||
<p>School information is temporarily unavailable. Please try again.</p>
|
||
<button type="button" onClick={reset}>Try again</button>
|
||
<p><a href="/">Return to school search</a></p>
|
||
</main>
|
||
);
|
||
}
|