Commit 5f36535a authored by Brad King's avatar Brad King
Browse files

error: Look for 'error' field in Gitlab error objects

Some errors from Gitlab put the message in an `error` member
instead of `message`.
parent 138b799b
...@@ -42,6 +42,7 @@ impl Error { ...@@ -42,6 +42,7 @@ impl Error {
pub fn from_gitlab(value: Value) -> Self { pub fn from_gitlab(value: Value) -> Self {
let msg = value let msg = value
.pointer("/message") .pointer("/message")
.or_else(|| value.pointer("/error"))
.and_then(|s| s.as_str()) .and_then(|s| s.as_str())
.unwrap_or_else(|| "unknown error"); .unwrap_or_else(|| "unknown error");
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