+/// HTTP error consisting of a status code and body contents.
+#[derive(Debug)]
+pub(crate) struct HttpError {
+ pub(crate) status_code: String,
+ pub(crate) contents: Vec<u8>,
+}
+
+impl std::error::Error for HttpError {}
+
+impl fmt::Display for HttpError {
+ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+ let contents = String::from_utf8_lossy(&self.contents);
+ write!(f, "status_code: {}, contents: {}", self.status_code, contents)
+ }
+}
+