diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2019-01-09 23:51:44 -0800 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2019-01-09 23:51:44 -0800 |
commit | a192b0b84e46179a8f28218dfcbb5eb4e28dbf9d (patch) | |
tree | f5ea70e1863fbc15a629382b4c189d914c8a555a /rust/fatcat-api-spec/src/client.rs | |
parent | 7632129c594b9edbae8ee9ba5da6ae35d1af2429 (diff) | |
download | fatcat-a192b0b84e46179a8f28218dfcbb5eb4e28dbf9d.tar.gz fatcat-a192b0b84e46179a8f28218dfcbb5eb4e28dbf9d.zip |
add a couple additional response types, for consistency
Diffstat (limited to 'rust/fatcat-api-spec/src/client.rs')
-rw-r--r-- | rust/fatcat-api-spec/src/client.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/rust/fatcat-api-spec/src/client.rs b/rust/fatcat-api-spec/src/client.rs index 5937b7f2..c5cf4297 100644 --- a/rust/fatcat-api-spec/src/client.rs +++ b/rust/fatcat-api-spec/src/client.rs @@ -2570,6 +2570,13 @@ impl Api for Client { Ok(CreateEditgroupResponse::Forbidden(body)) } + 404 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::<models::ErrorResponse>(&buf)?; + + Ok(CreateEditgroupResponse::NotFound(body)) + } 500 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -2619,6 +2626,13 @@ impl Api for Client { Ok(GetChangelogResponse::Success(body)) } + 400 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::<models::ErrorResponse>(&buf)?; + + Ok(GetChangelogResponse::BadRequest(body)) + } 500 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; @@ -2669,6 +2683,13 @@ impl Api for Client { Ok(GetChangelogEntryResponse::FoundChangelogEntry(body)) } + 400 => { + let mut buf = String::new(); + response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; + let body = serde_json::from_str::<models::ErrorResponse>(&buf)?; + + Ok(GetChangelogEntryResponse::BadRequest(body)) + } 404 => { let mut buf = String::new(); response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?; |