Commit b82b2f63 authored by Brad King's avatar Brad King Committed by Kitware Robot
Browse files

Merge topic 'gitlab-server-error'


 gitlab: report server errors without trying to deserialize
Acked-by: Kitware Robot's avatarKitware Robot <>
Merge-request: !132
parents 7bdf95da c21d47ea
......@@ -675,7 +675,13 @@ impl Gitlab {
let rsp = req.send().chain_err(|| ErrorKind::Communication)?;
let success = rsp.status().is_success();
let status = rsp.status();
if status.is_server_error() {
return Err(ErrorKind::Gitlab(
format!("server error: {} {:?}", status.as_u16(),
let success = status.is_success();
let v = serde_json::from_reader(rsp).chain_err(|| ErrorKind::Deserialize)?;
if !success {
return Err(Error::from_gitlab(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