2017-03-25 13:44:22 +00:00
|
|
|
#[cfg(feature = "scram")]
|
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-03-25 13:44:22 +00:00
|
|
|
#[cfg(feature = "scram")]
|
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),
|
|
|
|
}
|
|
|
|
|
2017-03-25 13:44:22 +00:00
|
|
|
#[cfg(feature = "scram")]
|
2017-02-27 15:08:09 +00:00
|
|
|
impl From<ErrorStack> for Error {
|
|
|
|
fn from(err: ErrorStack) -> Error {
|
|
|
|
Error::OpenSslErrorStack(err)
|
|
|
|
}
|
|
|
|
}
|