Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions src/pages/500.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,23 @@ import PageContainer from '../components/PageContainer';

import { pages } from '../util/constants';

export default ({ reqId }: { reqId: string }) => (
export default ({ reqId, isTimeout }: { reqId: string; isTimeout?: boolean }) => (
<>
<PageContainer>
<div style={{ textAlign: 'center', marginBottom: '2rem' }}>
<h1>500 Internal Server Error</h1>

<p>Oops, the package failed to install.</p>
<p style={{ maxWidth: '500px' }}>
This can happen when there is no prebuilt binary for node@
{process.versions.node} or the install script requires CLIs like
python/curl/etc.
{isTimeout ? (
'This can happen when the package took too long to install and the request timed out.'
) : (
<>
This can happen when there is no prebuilt binary for node@
{process.versions.node} or the install script requires CLIs like
python/curl/etc.
</>
)}
</p>
<p>
<a href={pages.index}>Go Home</a>
Expand Down
4 changes: 3 additions & 1 deletion src/pages/_document.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,10 @@ async function routePage(
if (err instanceof NotFoundError) {
return <NotFound resource={err.resource} />;
}
const isTimeout =
err instanceof Error && 'code' in err && (err as any).code === 'ABORT_ERR';
console.error('Unexpected Error Occurred...', err);
return <ServerError reqId={reqId} />;
return <ServerError reqId={reqId} isTimeout={isTimeout} />;
}
}

Expand Down