safe_box/
err.rs

1use thiserror::Error;
2
3#[derive(Error, Debug)]
4pub enum SafeBoxError {
5    /// Database error.
6    #[error(transparent)]
7    DB(#[from] sqlx::error::Error),
8
9    /// Password hashing error.
10    #[error(transparent)]
11    Argon2(#[from] argon2::Error),
12
13    #[error("user '{0}' does not exist")]
14    UserNotExist(String),
15
16    #[error("user '{0}' already exists")]
17    UserAlreadyExist(String),
18
19    #[error("invalid database: {0}")]
20    InvalidData(String),
21}