-
Notifications
You must be signed in to change notification settings - Fork 70
Trace all HTTP codes other than 200 as errors #575
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
Conversation
|
Looks good but you forgot to check format! |
josh-proxy/src/bin/josh-proxy.rs
Outdated
| let _e = s.enter(); | ||
| let http_status = r.status().as_u16() | ||
| let log_level = match http_status { | ||
| 200 => tracing::Level::TRACE, |
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.
I would prefer something like:
< 400 -> TRACE // All different kinds of success
< 500 -> WARN // Something wrong with the request, clients fault
_ -> ERROR // Server side error, need to debug josh
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.
Actually, the first should probably be <= 401, as "unauthorized" is a very common and normal response that will happen pretty much all the time without any need for concern.
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.
@christian-schilling but it also returns 500 here when checkout URL is malformed
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.
ah I think it still makes sense. Thanks, I'll update the PR a bit later
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.
If it returns 500 when the URL is malformed that's a bug in itself, it should be something 4xx.
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.
817092e to
05d2a56
Compare
This allows to raise logging level but still see 500, 404 errors etc
05d2a56 to
29545b0
Compare

This allows to raise logging level but still see 500, 404 errors etc