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

Support xml error respsonse #1631

Merged
merged 10 commits into from
Apr 19, 2024
Merged

Conversation

merlinio2000
Copy link
Contributor

@merlinio2000 merlinio2000 commented Mar 28, 2024

closes #1275

As mentioned in the issue for those places that only need the error code it would've been easier to get it from the headers but I'm unsure whether there are any case where this information is only provided through the body.
So to keep the current behavior I decided to keep parsing it from the body (now based on content-type though)

If you think it would be alright to rely solely on the headers than I'd be happy to change that, it would remove a bit of code and prevent having to parse the body in some cases.

EDIT: Thanks to the all_tests script I discovered the issue of quick-xml being behind the xml feature flag.
I see two options but don't know which one is better:

  • dont feature gatequick-xml / remove the xml feature
  • create a non-xml version of the body parsing and gate the current one behind the xml feature (needs documentation)

To quick fix for CI I will remove quick-xml from the xml feature for now. I'm thankful for any further guidance here

@merlinio2000 merlinio2000 marked this pull request as draft March 28, 2024 14:24
sdk/core/Cargo.toml Outdated Show resolved Hide resolved
@merlinio2000 merlinio2000 marked this pull request as ready for review April 2, 2024 13:18
Copy link
Member

@heaths heaths left a comment

Choose a reason for hiding this comment

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

Looking much better, but a few changes would be good.

sdk/core/src/error/mod.rs Outdated Show resolved Hide resolved
sdk/core/src/error/mod.rs Outdated Show resolved Hide resolved
sdk/core/src/error/http_error.rs Show resolved Hide resolved
sdk/core/src/error/http_error.rs Show resolved Hide resolved
merlinio2000 and others added 3 commits April 5, 2024 09:29
Co-authored-by: Heath Stewart <heaths@outlook.com>
Co-authored-by: Heath Stewart <heaths@outlook.com>
Co-authored-by: Heath Stewart <heaths@outlook.com>
Copy link
Member

@heaths heaths left a comment

Choose a reason for hiding this comment

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

Please revert the headers change and it looks good to merge. We want to keep it as that type because callers can always convert, but Headers may provide additional APIs a simple HashMap may not.

sdk/core/src/error/http_error.rs Outdated Show resolved Hide resolved
@heaths heaths enabled auto-merge (squash) April 18, 2024 22:17
@heaths heaths merged commit d5b8a4c into Azure:main Apr 19, 2024
22 checks passed
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.

HttpError::error_message() is unexpectedly None
3 participants