aboutsummaryrefslogtreecommitdiffstats
path: root/rust/fatcat-api/src/client.rs
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2018-05-16 22:15:14 -0700
committerBryan Newbold <bnewbold@robocracy.org>2018-05-16 22:15:14 -0700
commitf3b2432664b28bd979d1600c2200e3fe41c8e380 (patch)
treeab7912f972deddfb35a1686b8a1dbddd03d78d7e /rust/fatcat-api/src/client.rs
parent2c9edb5c394d9fc75cf3be49a157763506e1265c (diff)
downloadfatcat-f3b2432664b28bd979d1600c2200e3fe41c8e380.tar.gz
fatcat-f3b2432664b28bd979d1600c2200e3fe41c8e380.zip
api tweaks
Diffstat (limited to 'rust/fatcat-api/src/client.rs')
-rw-r--r--rust/fatcat-api/src/client.rs11
1 files changed, 9 insertions, 2 deletions
diff --git a/rust/fatcat-api/src/client.rs b/rust/fatcat-api/src/client.rs
index 09b43e4b..0c1345de 100644
--- a/rust/fatcat-api/src/client.rs
+++ b/rust/fatcat-api/src/client.rs
@@ -616,7 +616,14 @@ impl Api for Client {
response.read_to_string(&mut buf).map_err(|e| ApiError(format!("Response was not valid UTF8: {}", e)))?;
let body = serde_json::from_str::<models::Editgroup>(&buf)?;
- Ok(EditgroupIdGetResponse::FoundEditgroup(body))
+ Ok(EditgroupIdGetResponse::FoundEntity(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(EditgroupIdGetResponse::BadRequest(body))
}
404 => {
let mut buf = String::new();
@@ -724,7 +731,7 @@ impl Api for Client {
200 => {
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::Changelogentry>(&buf)?;
+ let body = serde_json::from_str::<models::Changelogentries>(&buf)?;
Ok(EditorUsernameChangelogGetResponse::FoundMergedChanges(body))
}