mirror of
https://github.com/lldap/lldap.git
synced 2026-06-15 23:26:36 +00:00
Note that if there was a non-lowercase user already in the DB, it cannot be found again. To fix this, run in the DB: sqlite> UPDATE users SET user_id = LOWER(user_id);
23 lines
831 B
Rust
23 lines
831 B
Rust
use thiserror::Error;
|
|
|
|
#[allow(clippy::enum_variant_names)]
|
|
#[derive(Error, Debug)]
|
|
pub enum DomainError {
|
|
#[error("Authentication error: `{0}`")]
|
|
AuthenticationError(String),
|
|
#[error("Database error: `{0}`")]
|
|
DatabaseError(#[from] sqlx::Error),
|
|
#[error("Authentication protocol error for `{0}`")]
|
|
AuthenticationProtocolError(#[from] lldap_auth::opaque::AuthenticationError),
|
|
#[error("Unknown crypto error: `{0}`")]
|
|
UnknownCryptoError(#[from] orion::errors::UnknownCryptoError),
|
|
#[error("Binary serialization error: `{0}`")]
|
|
BinarySerializationError(#[from] bincode::Error),
|
|
#[error("Invalid base64: `{0}`")]
|
|
Base64DecodeError(#[from] base64::DecodeError),
|
|
#[error("Internal error: `{0}`")]
|
|
InternalError(String),
|
|
}
|
|
|
|
pub type Result<T> = std::result::Result<T, DomainError>;
|