Skip to content

Conversation

@vlad-ivanov-name
Copy link
Collaborator

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

@LMG
Copy link
Collaborator

LMG commented Dec 30, 2021

Looks good but you forgot to check format!

let _e = s.enter();
let http_status = r.status().as_u16()
let log_level = match http_status {
200 => tracing::Level::TRACE,

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

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.

Copy link
Collaborator Author

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

Copy link
Collaborator Author

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

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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

This allows to raise logging level but still see 500, 404 errors etc
@christian-schilling christian-schilling merged commit 747a761 into master Dec 31, 2021
@christian-schilling christian-schilling deleted the report-http-errors branch December 31, 2021 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants