-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(sveltekit): Avoid capturing Http 4xx errors on the client #10571
Conversation
size-limit report 📦
|
// Neither 400 errors, given that they are not valuable. | ||
if ( | ||
isRedirect(objectifiedErr) || | ||
(isHttpError(objectifiedErr) && objectifiedErr.status < 500 && objectifiedErr.status >= 400) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so, the issue linked complains about 403 errors being captured, it talks about ignoring all 4xx errors, but we only ignore 400 - is that correct/on purpose?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's on purpose in the sense that we have the same logic on the server side and generally, afaik, we never want to capture 4xx errors by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ahh wait, I got confused by the comment which says neither 400
errors and thought this was filtering only 400 itself, not 403. all good then!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ahh sorry, that was my mistake. 4xx is definitely the better description
Co-authored-by: Francesco Novy <[email protected]>
Add the Http 400 avoidance logic from our server-side `load` function instrumentation to the client-side wrapper. Didn't know that these errors were a thing on the client side but now that we know, we definitely don't want to capture them. Co-authored-by: Francesco Novy <[email protected]>
Add the Http 400 avoidance logic from our server-side `load` function instrumentation to the client-side wrapper. Didn't know that these errors were a thing on the client side but now that we know, we definitely don't want to capture them. Co-authored-by: Francesco Novy <[email protected]>
This PR adds the Http 400 avoidance logic from our server-side
load
function instrumentation to the client-side wrapper. Didn't know that these errors were a thing on the client side but now that we know, we definitely don't want to capture them.Also added tests
closes #10568