diff --git a/src/state.rs b/src/state.rs index 6032642..994ecbf 100644 --- a/src/state.rs +++ b/src/state.rs @@ -23,10 +23,36 @@ pub struct Creds { pub password: Secret, } -#[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 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]