sqlx_utils/error.rs
1use std::borrow::Cow;
2use thiserror::Error;
3
4pub type Result<T, E = Error> = core::result::Result<T, E>;
5
6#[derive(Error, Debug)]
7pub enum Error {
8 #[error("An error occurred while executing query: {message}")]
9 Repository { message: Cow<'static, str> },
10 #[error(transparent)]
11 Sqlx(#[from] sqlx::Error),
12 #[error("Failed to acquire lock on mutex")]
13 MutexLockError,
14 #[error(transparent)]
15 Boxed(Box<dyn std::error::Error + Send>),
16}