Store richer Box<dyn StdError> in Error::Other

This commit is contained in:
Dirkjan Ochtman 2021-12-22 11:03:02 +01:00 committed by masalachai
parent 6d063804d3
commit abab1aca8c
2 changed files with 3 additions and 3 deletions

View File

@ -147,7 +147,7 @@ async fn epp_connect(
.collect(); .collect();
builder builder
.with_single_cert(certs, rustls::PrivateKey(key.0)) .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(), None => builder.with_no_client_auth(),
}; };

View File

@ -12,7 +12,7 @@ pub enum Error {
Io(std::io::Error), Io(std::io::Error),
Command(ResponseStatus), Command(ResponseStatus),
Xml(Box<dyn StdError>), Xml(Box<dyn StdError>),
Other(String), Other(Box<dyn StdError>),
} }
impl StdError for Error {} impl StdError for Error {}
@ -31,7 +31,7 @@ impl Display for Error {
impl From<Box<dyn StdError>> for Error { impl From<Box<dyn StdError>> for Error {
fn from(e: Box<dyn StdError>) -> Self { fn from(e: Box<dyn StdError>) -> Self {
Self::Other(format!("{:?}", e)) Self::Other(e)
} }
} }