Skip to content

Commit

Permalink
fix(remix): Do not capture error responses that are not 5xx on Remix v2.
Browse files Browse the repository at this point in the history
  • Loading branch information
onurtemizkan committed Nov 27, 2023
1 parent 739d904 commit 6f2d67e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/remix/src/client/errors.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ import type { ErrorResponse } from '../utils/vendor/types';
export function captureRemixErrorBoundaryError(error: unknown): string | undefined {
let eventId: string | undefined;
const isClientSideRuntimeError = !isNodeEnv() && error instanceof Error;
const isRemixErrorResponse = isRouteErrorResponse(error);
// We only capture `ErrorResponse`s that are 5xx errors.
const isRemixErrorResponse = isRouteErrorResponse(error) && error.status >= 500;
// Server-side errors apart from `ErrorResponse`s also appear here without their stacktraces.
// So, we only capture:
// 1. `ErrorResponse`s
Expand Down

0 comments on commit 6f2d67e

Please sign in to comment.