This commit is contained in:
Daniel Flanagan 2024-07-14 20:21:52 -05:00
parent d2b67d5071
commit f3f2be99f3

View file

@ -23,10 +23,36 @@ pub struct Creds {
pub password: Secret<String>,
}
#[derive(thiserror::Error, Debug)]
pub enum AuthnError {
#[error("{0}")]
Eyre(#[from] Error),
#[derive(Debug)]
pub struct AuthnError {}
impl std::fmt::Display for AuthnError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("authentication error");
Ok(())
}
}
impl From<Error> for AuthnError {
fn from(_value: Error) -> Self {
Self {}
}
}
impl std::error::Error for AuthnError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
None
}
fn description(&self) -> &str {
"description() is deprecated; use Display"
}
fn cause(&self) -> Option<&dyn std::error::Error> {
self.source()
}
fn provide<'a>(&'a self, request: &mut std::error::Request<'a>) {}
}
#[async_trait]