Skip to content

Commit

Permalink
accept other 2XX codes as OK
Browse files Browse the repository at this point in the history
  • Loading branch information
joksas committed Aug 22, 2024
1 parent fa520dc commit a496f36
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
authors = ["RSS Blue", "Dovydas Joksas"]
name = "v4v"
version = "0.5.8"
version = "0.5.9"
edition = "2021"
description = "Value-for-value helper utilities for Podcasting 2.0"
license = "MIT OR Apache-2.0"
Expand Down
4 changes: 3 additions & 1 deletion src/alby/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,9 @@ pub async fn make_request<T: DeserializeOwned>(args: RequestArgs<'_>) -> Result<
println!("{}", body);

match status.as_u16() {
200 => Ok(serde_json::from_str(&body).map_err(|e| RequestError::ResponseParse(e, body))?),
200..299 => {
Ok(serde_json::from_str(&body).map_err(|e| RequestError::ResponseParse(e, body))?)
}
400 => {
let error_response: ErrorResponse = serde_json::from_str(&body)
.map_err(|e| RequestError::ResponseParse(e, body.clone()))?;
Expand Down

0 comments on commit a496f36

Please sign in to comment.