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

Improve HTTP header errors #3779

Merged
merged 5 commits into from
Aug 7, 2024
Merged

Improve HTTP header errors #3779

merged 5 commits into from
Aug 7, 2024

Conversation

Velfi
Copy link
Contributor

@Velfi Velfi commented Aug 1, 2024

This improves error messaging for HTTP header related errors.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@Velfi Velfi requested a review from a team as a code owner August 1, 2024 20:41
Copy link
Collaborator

@rcoh rcoh left a comment

Choose a reason for hiding this comment

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

strongly recommend adding some tests of invalid headers and ensuring that you get errors that help to trace back to the source.

{
Err(HttpError::header_was_not_a_string(e))
Err(HttpError::not_utf8(not_utf8.as_bytes()))
Copy link
Collaborator

Choose a reason for hiding this comment

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

seems like including the actual header here (including the key!) would be more helpful

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can't always include the key because some header-related methods focus solely on the value. For cases where the key is available, I've added it to the error message.

rust-runtime/aws-smithy-runtime-api/src/http/error.rs Outdated Show resolved Hide resolved
Copy link

github-actions bot commented Aug 1, 2024

A new generated diff is ready to view.

A new doc preview is ready to view.

@Velfi Velfi requested a review from a team as a code owner August 7, 2024 21:22
@Velfi
Copy link
Contributor Author

Velfi commented Aug 7, 2024

strongly recommend adding some tests of invalid headers and ensuring that you get errors that help to trace back to the source.

I still don't fully understand where the error is coming from. I'd like to release what I have because I expect it to help and then I'll work on tracking down the source afterwards.

Copy link

github-actions bot commented Aug 7, 2024

A new generated diff is ready to view.

A new doc preview is ready to view.

@Velfi Velfi added this pull request to the merge queue Aug 7, 2024
Merged via the queue into main with commit 433e1a0 Aug 7, 2024
44 checks passed
@Velfi Velfi deleted the zhessler-improve-http-header-errors branch August 7, 2024 22:49
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.

3 participants