Skip to content

Conversation

@vilgotf
Copy link
Member

@vilgotf vilgotf commented Aug 11, 2021

These errors should be the other way around

@7596ff 7596ff added c-http Affects the http crate t-fix Fixes a bug in the library labels Aug 11, 2021
spring4175
spring4175 previously approved these changes Aug 17, 2021
@spring4175 spring4175 self-requested a review August 17, 2021 13:34
@spring4175 spring4175 dismissed their stale review August 17, 2021 13:35

Double checking

@spring4175 spring4175 merged commit 3036fba into twilight-rs:main Aug 17, 2021
@spring4175
Copy link
Contributor

Thanks for the PR

@vilgotf vilgotf deleted the fix/http/response-error branch August 17, 2021 16:14
spring4175 added a commit that referenced this pull request Aug 18, 2021
Additions

Add 6 new HTTP API error codes:

- 10049: Unknown stream
- 10050: Unknown premium server subscribe cooldown
- 10070: Unknown Guild Scheduled Event
- 10071: Unknown Guild Scheduled Event User
- 50095: This server is not available in your location
- 50097: This server needs monetization enabled in order to perform this
action

([#1094] - [@Erk-]).

Fixes

Fix `ResponseFuture` returning mismatched `RequestTimedOut` and
`RequestError` error type variants ([#1100] - [@vilgotf]).

Enhancements

Improve the performance of `Response::bytes` ([#1103] - [@vilgotf]).

Add `[#must_use]` to typed HTTP request builders
([#1099] - [@zeylahellyer]).

[@Erk-]: https://github.com/Erk-
[@vilgotf]: https://github.com/vilgotf
[@zeylahellyer]: https://github.com/zeylahellyer
[#1103]: #1103
[#1100]: #1100
[#1099]: #1099
[#1094]: #1094

Signed-off-by: Zeyla Hellyer <zeyla@hellyer.dev>
7596ff pushed a commit to 7596ff/twilight that referenced this pull request Aug 25, 2021
The `ResponseFuture`'s underlying HTTP client execution future has a
timeout on it. The `match` branch for how to handle the result of the
execution has three cases:

1. The request being successfully executed and getting an HTTP client
response back
2. The request timing out
3. An error while executing the request

In the handling of cases two and three the error would be transformed
into our own error type, but the handling for it is reversed: if a
request timed out we'd say there was an error executing the request
and vice versa.

This fixes that by reversing the error types in the branches.
7596ff pushed a commit to 7596ff/twilight that referenced this pull request Aug 25, 2021
Additions

Add 6 new HTTP API error codes:

- 10049: Unknown stream
- 10050: Unknown premium server subscribe cooldown
- 10070: Unknown Guild Scheduled Event
- 10071: Unknown Guild Scheduled Event User
- 50095: This server is not available in your location
- 50097: This server needs monetization enabled in order to perform this
action

([twilight-rs#1094] - [@Erk-]).

Fixes

Fix `ResponseFuture` returning mismatched `RequestTimedOut` and
`RequestError` error type variants ([twilight-rs#1100] - [@vilgotf]).

Enhancements

Improve the performance of `Response::bytes` ([twilight-rs#1103] - [@vilgotf]).

Add `[#must_use]` to typed HTTP request builders
([twilight-rs#1099] - [@zeylahellyer]).

[@Erk-]: https://github.com/Erk-
[@vilgotf]: https://github.com/vilgotf
[@zeylahellyer]: https://github.com/zeylahellyer
[twilight-rs#1103]: twilight-rs#1103
[twilight-rs#1100]: twilight-rs#1100
[twilight-rs#1099]: twilight-rs#1099
[twilight-rs#1094]: twilight-rs#1094

Signed-off-by: Zeyla Hellyer <zeyla@hellyer.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c-http Affects the http crate t-fix Fixes a bug in the library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants