24 lines
443 B
Rust
24 lines
443 B
Rust
#[derive(Debug, thiserror::Error)]
|
|
pub enum Error {
|
|
#[error("user not found")]
|
|
UserNotFound,
|
|
|
|
#[error("sqlx error - {0}")]
|
|
SQLx(sqlx::Error),
|
|
|
|
#[error("std::io error - {0}")]
|
|
Io(std::io::Error),
|
|
}
|
|
|
|
impl From<sqlx::Error> for Error {
|
|
fn from(err: sqlx::Error) -> Self {
|
|
Error::SQLx(err)
|
|
}
|
|
}
|
|
|
|
impl From<std::io::Error> for Error {
|
|
fn from(err: std::io::Error) -> Self {
|
|
Error::Io(err)
|
|
}
|
|
}
|