26 lines
478 B
Rust
26 lines
478 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),
|
|
}
|
|
|
|
/// sqlx::Error
|
|
impl From<sqlx::Error> for Error {
|
|
fn from(err: sqlx::Error) -> Self {
|
|
Error::SQLx(err)
|
|
}
|
|
}
|
|
|
|
/// std::io::Error
|
|
impl From<std::io::Error> for Error {
|
|
fn from(err: std::io::Error) -> Self {
|
|
Error::Io(err)
|
|
}
|
|
}
|