Skip to content

Commit

Permalink
Merge pull request #197 from ctron/feature/fix_error_msg_1
Browse files Browse the repository at this point in the history
fix: show actual response status field
  • Loading branch information
flavio authored Jan 24, 2023
2 parents 94ed63b + 0e037cc commit 3d3e786
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/rekor/apis/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,15 @@ pub enum Error<T> {
source: std::io::Error,
},

#[error("error in response: status code {{error.status:?}}")]
#[error("error in response: status code {:?}", error_status(.0))]
ResponseError(ResponseContent<T>),
}

#[inline]
fn error_status<T>(response: &ResponseContent<T>) -> reqwest::StatusCode {
response.status
}

pub fn urlencode<T: AsRef<str>>(s: T) -> String {
::url::form_urlencoded::byte_serialize(s.as_ref().as_bytes()).collect()
}
Expand Down

0 comments on commit 3d3e786

Please sign in to comment.