#[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 for Error { fn from(err: sqlx::Error) -> Self { Error::SQLx(err) } } impl From for Error { fn from(err: std::io::Error) -> Self { Error::Io(err) } }