use core::{error, fmt};
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum AuthError {
IllegalParameter {
name: &'static str,
},
BadRecordMac {
peer: &'static str,
},
}
impl fmt::Display for AuthError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Self::IllegalParameter { name } => {
write!(f, "illegal_parameter: bad '{name}' value")
}
Self::BadRecordMac { peer } => {
write!(f, "bad_record_mac: incorrect '{peer}' proof")
}
}
}
}
impl error::Error for AuthError {}