Skip to content

Commit 6f2d67e

Browse files
committed
fix(remix): Do not capture error responses that are not 5xx on Remix v2.
1 parent 739d904 commit 6f2d67e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/remix/src/client/errors.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ import type { ErrorResponse } from '../utils/vendor/types';
1313
export function captureRemixErrorBoundaryError(error: unknown): string | undefined {
1414
let eventId: string | undefined;
1515
const isClientSideRuntimeError = !isNodeEnv() && error instanceof Error;
16-
const isRemixErrorResponse = isRouteErrorResponse(error);
16+
// We only capture `ErrorResponse`s that are 5xx errors.
17+
const isRemixErrorResponse = isRouteErrorResponse(error) && error.status >= 500;
1718
// Server-side errors apart from `ErrorResponse`s also appear here without their stacktraces.
1819
// So, we only capture:
1920
// 1. `ErrorResponse`s

0 commit comments

Comments
 (0)