diff --git a/src/connection.rs b/src/connection.rs index f72f591..258b6e7 100644 --- a/src/connection.rs +++ b/src/connection.rs @@ -147,7 +147,7 @@ async fn epp_connect( .collect(); builder .with_single_cert(certs, rustls::PrivateKey(key.0)) - .map_err(|e| Error::Other(e.to_string()))? + .map_err(|e| Error::Other(e.into()))? } None => builder.with_no_client_auth(), }; diff --git a/src/error.rs b/src/error.rs index 2f9a983..100f896 100644 --- a/src/error.rs +++ b/src/error.rs @@ -12,7 +12,7 @@ pub enum Error { Io(std::io::Error), Command(ResponseStatus), Xml(Box), - Other(String), + Other(Box), } impl StdError for Error {} @@ -31,7 +31,7 @@ impl Display for Error { impl From> for Error { fn from(e: Box) -> Self { - Self::Other(format!("{:?}", e)) + Self::Other(e) } }