diff --git a/Cargo.toml b/Cargo.toml index cdf11ed..6858b97 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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" diff --git a/src/alby/helpers.rs b/src/alby/helpers.rs index 6ebcde0..ce5fa3f 100644 --- a/src/alby/helpers.rs +++ b/src/alby/helpers.rs @@ -144,7 +144,9 @@ pub async fn make_request(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()))?;