Skip to content

Commit dc5562f

Browse files
committed
move error log to avoid failing to log certain errors
1 parent 927c8b6 commit dc5562f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

app/components/ErrorBoundary.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ export const trigger404 = { type: 'error', statusCode: 404 }
1717
type Props = { error: Error | ApiError }
1818

1919
function ErrorFallback({ error }: Props) {
20+
console.error(error)
21+
2022
if ('statusCode' in error && error.statusCode === 404) {
2123
return <NotFound />
2224
}
@@ -38,6 +40,5 @@ export const ErrorBoundary = (props: { children: React.ReactNode }) => (
3840
export function RouterDataErrorBoundary() {
3941
// TODO: validate this unknown at runtime _before_ passing to ErrorFallback
4042
const error = useRouteError() as Props['error']
41-
console.error(error)
4243
return <ErrorFallback error={error} />
4344
}

0 commit comments

Comments
 (0)