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

HTTP Status Code Checks #190

Merged
merged 4 commits into from
Jun 5, 2023
Merged

Conversation

maxall41
Copy link
Contributor

@maxall41 maxall41 commented Jun 1, 2023

Checks if the status code returned from an http request in the HttpRequest source is between 200 - 299 (OK). Otherwise returns error. Resolves issue #184

Copy link
Member

@FelixMcFelix FelixMcFelix left a comment

Choose a reason for hiding this comment

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

Thanks for your work, I've left some comments on how to make use of the existing error types; I apologise that I've not really documented the "developer intent" around how they should be treated.

src/input/error.rs Outdated Show resolved Hide resolved
src/input/error.rs Outdated Show resolved Hide resolved
src/input/sources/http.rs Outdated Show resolved Hide resolved
Copy link
Member

@FelixMcFelix FelixMcFelix left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@FelixMcFelix FelixMcFelix merged commit 94a0317 into serenity-rs:next Jun 5, 2023
FelixMcFelix pushed a commit to FelixMcFelix/songbird that referenced this pull request Nov 20, 2023
`HttpRequest`s will now return an `AudioStreamError::Fail` on receipt of a non-2xx status code from a server. This has the advantage of making it clearer *why* a failure occurred rather than leaving users to piece the truth together from a Symphonia parsing error.

Closes serenity-rs#184.
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.

2 participants