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

chore(volo-http): use less Result in client #509

Merged
merged 1 commit into from
Oct 12, 2024

Conversation

yukiiiteru
Copy link
Member

Motivation

There are too many Results in the return values of RequestBuilder's methods, so a large number of unwraps need to be used, resulting in a poor user experience.

Solution

This PR updates Request to Result<Request> in RequestBuilder, and makes the methods of RequestBuilder no longer use Result as the return type.

These methods no longer return Err directly, but save it in Result<Request> and throw it when trying to send a request.

This commit updates `Request` to `Result<Request>` in
`RequestBuilder`, and makes the methods of `RequestBuilder` no longer
use `Result` as the return type. These methods no longer return `Err`
directly, but save it in `Result<Request>` and throw it when trying to
send a request.

Signed-off-by: Yu Li <[email protected]>
@yukiiiteru yukiiiteru merged commit 0c2e384 into cloudwego:main Oct 12, 2024
15 checks passed
@yukiiiteru yukiiiteru deleted the chore/less-result branch October 12, 2024 03:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants