use thiserror::Error;
#[derive(Error, Debug)]
#[error(transparent)]
#[non_exhaustive]
pub enum AuthenticationError {
#[error("The credentials provided were invalid")]
InvalidCredentials,
#[error("An MFA code is required to complete the authentication process")]
MfaCodeRequired,
#[error("An error occurred while trying to communicate with the Ring OAuth API")]
OAuthError(#[from] reqwest::Error),
#[error("An error occurred while decoding the response from the Ring OAuth API: {0}")]
InvalidResponse(#[from] serde_json::Error),
#[error("The presented challenge is not supported. Challenge was: {0}")]
UnsupportedChallenge(String),
#[error("An error occurred while trying to set the session details with Ring")]
SessionFailed,
}