Skip to content

Commit

Permalink
fix(remix): Do not capture 4xx codes from thrown responses. (#5441)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
onurtemizkan committed Jul 21, 2022
1 parent a60edf8 commit 25c3dc7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/remix/src/utils/instrumentServer.ts
Expand Up @@ -100,9 +100,9 @@ function extractData(response: Response): Promise<unknown> {
}

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

Expand Down

0 comments on commit 25c3dc7

Please sign in to comment.