Bring back NetworkError column

This commit is contained in:
Alex Gleason
2023-11-14 14:41:35 -06:00
parent c777d767d2
commit cdb89ae8fd
3 changed files with 75 additions and 16 deletions

View File

@ -200,4 +200,11 @@ const httpErrorMessages: { code: number; name: string; description: string }[] =
},
];
export { buildErrorMessage, httpErrorMessages };
/** Whether the error is caused by a JS chunk failing to load. */
function isNetworkError(error: unknown): boolean {
return error instanceof Error
&& error.name === 'TypeError'
&& error.message.startsWith('Failed to fetch dynamically imported module: ');
}
export { buildErrorMessage, httpErrorMessages, isNetworkError };