Skip to content

Commit a3a050e

Browse files
nichtsamkentcdodds
andauthored
don't cause sentry to attempt to capture a response object (#917)
Co-authored-by: Kent C. Dodds <[email protected]>
1 parent 39aa6eb commit a3a050e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

app/components/error-boundary.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,21 @@ export function GeneralErrorBoundary({
2828
}) {
2929
const error = useRouteError()
3030
const params = useParams()
31+
const isResponse = isRouteErrorResponse(error)
3132

3233
if (typeof document !== 'undefined') {
3334
console.error(error)
3435
}
3536

3637
useEffect(() => {
38+
if (isResponse) return
39+
3740
captureException(error)
38-
}, [error])
41+
}, [error, isResponse])
3942

4043
return (
4144
<div className="container flex items-center justify-center p-20 text-h2">
42-
{isRouteErrorResponse(error)
45+
{isResponse
4346
? (statusHandlers?.[error.status] ?? defaultStatusHandler)({
4447
error,
4548
params,

0 commit comments

Comments
 (0)