Store richer Box<dyn StdError> in Error::Other
This commit is contained in:
parent
6d063804d3
commit
abab1aca8c
|
@ -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(),
|
||||||
};
|
};
|
||||||
|
|
|
@ -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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue