use std::fmt;
#[derive(Debug)]
pub enum FbError {
DecodeError,
InvalidKey,
InvalidParams,
}
impl fmt::Display for FbError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let message = match self {
FbError::DecodeError => "Invalid input",
FbError::InvalidKey => "Invalid Key used",
FbError::InvalidParams => "One or more of the parameters are invalid or out of bounds. Valid bounds: (2 <= keybase_len <= cipher_len)",
};
f.write_fmt(format_args!("{message}"))
}
}
impl std::error::Error for FbError {}