2017-02-27 15:08:09 +00:00
|
|
|
use openssl::error::ErrorStack;
|
|
|
|
|
2017-02-28 12:05:17 +00:00
|
|
|
/// A wrapper enum for things that could go wrong in this crate.
|
2017-02-27 15:08:09 +00:00
|
|
|
#[derive(Debug)]
|
|
|
|
pub enum Error {
|
2017-02-28 12:05:17 +00:00
|
|
|
/// An error in OpenSSL.
|
2017-02-27 15:08:09 +00:00
|
|
|
OpenSslErrorStack(ErrorStack),
|
2017-02-28 12:05:17 +00:00
|
|
|
/// An error in a SASL mechanism.
|
2017-02-27 15:08:09 +00:00
|
|
|
SaslError(String),
|
|
|
|
}
|
|
|
|
|
|
|
|
impl From<ErrorStack> for Error {
|
|
|
|
fn from(err: ErrorStack) -> Error {
|
|
|
|
Error::OpenSslErrorStack(err)
|
|
|
|
}
|
|
|
|
}
|