summaryrefslogtreecommitdiffstats
path: root/src/errors.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/errors.rs')
-rw-r--r--src/errors.rs11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/errors.rs b/src/errors.rs
index 9d01f91..ef23ad3 100644
--- a/src/errors.rs
+++ b/src/errors.rs
@@ -6,15 +6,22 @@ use std::{error::Error as StdError, fmt, string::FromUtf8Error};
use futures_util::io::Error as IoError;
+/// Represents the result of all docker operations
+pub type Result<T> = std::result::Result<T, Error>;
+
#[derive(Debug)]
pub enum Error {
SerdeJsonError(SerdeError),
Hyper(hyper::Error),
Http(hyper::http::Error),
+ #[allow(clippy::upper_case_acronyms)]
IO(IoError),
Encoding(FromUtf8Error),
InvalidResponse(String),
- Fault { code: StatusCode, message: String },
+ Fault {
+ code: StatusCode,
+ message: String,
+ },
ConnectionNotUpgraded,
}
@@ -70,7 +77,7 @@ impl fmt::Display for Error {
Error::InvalidResponse(ref cause) => {
write!(f, "Response doesn't have the expected format: {}", cause)
}
- Error::Fault { code, .. } => write!(f, "{}", code),
+ Error::Fault { code, message } => write!(f, "{}: {}", code, message),
Error::ConnectionNotUpgraded => write!(
f,
"expected the docker host to upgrade the HTTP connection but it did not"