Skip to content
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

log: display client error messages when possible as warnings #691

Merged
merged 2 commits into from
Sep 3, 2020

Conversation

Fishrock123
Copy link
Member

This should help demystify some cases when client errors are determined by parsing and propagated via ?.

Description

Makes the logger display an associated error message when this warning occurs, if possible.

Also clarified that a client error occured.

Motivation and Context

For never users some cases of client errors being caused by e.g. body parsing and then propgated via ? may be unobvious. This helps demystify that.

How Has This Been Tested?

Manual curl to the json example. Output:

tide::log::middleware Client error --> Response sent
    message missing field `name` at line 1 column 2
    method POST
    path /submit
    status 422
    duration 73.9µs

Checklist:

  • I have read the CONTRIBUTING document.
  • All new and existing tests passed.

This should help demystify some cases when client errors are determined by parsing and propagated via `?`.
This should help the default logger be as helpful as possible.
Copy link
Member

@jbr jbr left a comment

Choose a reason for hiding this comment

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

👍

@Fishrock123 Fishrock123 merged commit b373610 into http-rs:main Sep 3, 2020
@Fishrock123 Fishrock123 deleted the logger-client-error-messages branch September 3, 2020 16:54
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.

2 participants