Add conversion from `s3::Error` into `util::Error`
@@ -8,6 +8,7 @@ pub enum Error {
Internal(String),
Io(io::Error),
JobEnqueue(swirl::EnqueueError),
+ Openssl(openssl::error::ErrorStack),
Reqwest(reqwest::Error),
}
@@ -22,6 +23,7 @@ impl fmt::Display for Error {
Error::Internal(inner) => inner.fmt(f),
Error::Io(inner) => inner.fmt(f),
Error::JobEnqueue(inner) => inner.fmt(f),
+ Error::Openssl(inner) => inner.fmt(f),
Error::Reqwest(inner) => inner.fmt(f),
}
}
@@ -63,6 +65,15 @@ impl From<swirl::EnqueueError> for Error {
}
}
+impl From<s3::Error> for Error {
+ fn from(err: s3::Error) -> Self {
+ match err {
+ s3::Error::Openssl(e) => Error::Openssl(e),
+ s3::Error::Reqwest(e) => Error::Reqwest(e),
+ }
+ }
+}
+
impl From<reqwest::Error> for Error {
fn from(err: reqwest::Error) -> Self {
Error::Reqwest(err)
