Commit 34cad70e authored by Ben Boeckel's avatar Ben Boeckel
Browse files

gitlab: refactor out the parsing of the result as JSON

parent 786b4269
...@@ -466,12 +466,12 @@ impl Gitlab { ...@@ -466,12 +466,12 @@ impl Gitlab {
{ {
req.header(GitlabPrivateToken(self.token.to_string())); req.header(GitlabPrivateToken(self.token.to_string()));
let rsp = req.send().chain_err(|| ErrorKind::Communication)?; let rsp = req.send().chain_err(|| ErrorKind::Communication)?;
if !rsp.status().is_success() { let success = rsp.status().is_success();
let v = serde_json::from_reader(rsp).chain_err(|| ErrorKind::Deserialize)?; let v = serde_json::from_reader(rsp).chain_err(|| ErrorKind::Deserialize)?;
if !success {
return Err(Error::from_gitlab(v)); return Err(Error::from_gitlab(v));
} }
let v = serde_json::from_reader(rsp).chain_err(|| ErrorKind::Deserialize)?;
debug!(target: "gitlab", debug!(target: "gitlab",
"received data: {:?}", "received data: {:?}",
v); v);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment