-
Notifications
You must be signed in to change notification settings - Fork 312
Add RawResponse
to ErrorKind::HttpResponse
#2983
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
Renames `RawResponse` to `BufResponse` - inspired by `std::io::BufReader`, and adds a new `RawResponse` where the body is fully read and stored in `Bytes`. Refactored `Headers` and other types necessary to add `RawResponse` to `ErrorKind::HttpResponse`. Fixes Azure#2962 Fixes Azure#2495 Relates to Azure#2725 Relates to Azure#1995
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.
Pull Request Overview
This PR renames RawResponse
to BufResponse
and introduces a new RawResponse
type that stores the complete response body as Bytes
. The new RawResponse
is added to ErrorKind::HttpResponse
to provide better error context. Additionally, it refactors Headers
and other HTTP-related types to support this change.
- Renamed
RawResponse
toBufResponse
throughout the codebase to reflect its streaming nature - Added new
RawResponse
that contains the complete response body asBytes
- Enhanced
ErrorKind::HttpResponse
to include the newRawResponse
for better error diagnostics
Reviewed Changes
Copilot reviewed 63 out of 70 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
sdk/typespec/src/error/mod.rs | Added raw_response field to ErrorKind::HttpResponse and updated constructors |
sdk/typespec/src/http/response.rs | Added new RawResponse struct with complete body as Bytes |
sdk/typespec/typespec_client_core/src/http/response.rs | Renamed RawResponse to BufResponse and added conversion method |
sdk/typespec/typespec_client_core/src/http/headers/mod.rs | Moved header types to typespec crate |
Multiple client files | Updated imports and type references from RawResponse to BufResponse |
Renames
RawResponse
toBufResponse
- inspired bystd::io::BufReader
, and adds a newRawResponse
where the body is fully read and stored inBytes
.Refactored
Headers
and other types necessary to addRawResponse
toErrorKind::HttpResponse
.Fixes #2962
Fixes #2495
Relates to #2725
Relates to #1995