2024-03-31 15:02:21 +00:00
|
|
|
#[derive(Debug, thiserror::Error, Clone)]
|
|
|
|
pub enum Error {
|
2024-03-31 15:55:53 +00:00
|
|
|
#[error("Failed to authenticate with the given password")]
|
|
|
|
WrongPassword,
|
|
|
|
|
2024-03-31 15:02:21 +00:00
|
|
|
#[error("Failed to handle a server response: {0}")]
|
|
|
|
BadResponse(String),
|
|
|
|
|
|
|
|
#[error("Failed to communicate with the host")]
|
|
|
|
ConnectionError,
|
|
|
|
|
|
|
|
#[error("Failed to authorize the session with the given token")]
|
|
|
|
InvalidToken,
|
|
|
|
|
|
|
|
#[error("The token used to authenticate the session is expired")]
|
|
|
|
TokenExpired,
|
|
|
|
|
|
|
|
#[error("{0}")]
|
|
|
|
Unknown(String),
|
2024-03-31 15:55:53 +00:00
|
|
|
|
|
|
|
#[error("The user was not found.")]
|
|
|
|
UserNotFound,
|
2024-03-31 15:02:21 +00:00
|
|
|
}
|