2017-03-25 13:44:22 +00:00
|
|
|
#[cfg(feature = "scram")]
|
2020-02-25 21:32:03 +00:00
|
|
|
use getrandom::Error as RngError;
|
2017-02-27 15:08:09 +00:00
|
|
|
|
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")]
|
2024-04-20 07:13:03 +00:00
|
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "scram")))]
|
2019-01-17 22:53:29 +00:00
|
|
|
/// An error while initializing the Rng.
|
|
|
|
RngError(RngError),
|
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")]
|
2024-04-20 07:13:03 +00:00
|
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "scram")))]
|
2019-01-17 22:53:29 +00:00
|
|
|
impl From<RngError> for Error {
|
|
|
|
fn from(err: RngError) -> Error {
|
|
|
|
Error::RngError(err)
|
2017-02-27 15:08:09 +00:00
|
|
|
}
|
|
|
|
}
|