Skip to content

Commit 25c3dc7

Browse files
authored
fix(remix): Do not capture 4xx codes from thrown responses. (#5441)
Fixes: #5425 Ref: #5429, #5405 As per review #5429 (comment), we need to define how and when we should capture a 4xx error. We will only capture thrown 5xx responses until then.
1 parent a60edf8 commit 25c3dc7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/remix/src/utils/instrumentServer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,9 @@ function extractData(response: Response): Promise<unknown> {
100100
}
101101

102102
function captureRemixServerException(err: Error, name: string): void {
103-
// Skip capturing if the thrown error is an OK Response
103+
// Skip capturing if the thrown error is not a 5xx response
104104
// https://remix.run/docs/en/v1/api/conventions#throwing-responses-in-loaders
105-
if (isResponse(err) && err.status < 400) {
105+
if (isResponse(err) && err.status < 500) {
106106
return;
107107
}
108108

0 commit comments

Comments
 (0)