mirror of
https://github.com/johrpan/musicus.git
synced 2025-10-26 19:57:25 +01:00
Move crates to subdirectory
This commit is contained in:
parent
1db96062fb
commit
ac4b29e86d
115 changed files with 10 additions and 5 deletions
24
crates/database/src/error.rs
Normal file
24
crates/database/src/error.rs
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
/// Error that happens within the database module.
|
||||
#[derive(thiserror::Error, Debug)]
|
||||
pub enum Error {
|
||||
#[error(transparent)]
|
||||
ConnectionError(#[from] diesel::result::ConnectionError),
|
||||
|
||||
#[error(transparent)]
|
||||
MigrationsError(#[from] diesel_migrations::RunMigrationsError),
|
||||
|
||||
#[error(transparent)]
|
||||
QueryError(#[from] diesel::result::Error),
|
||||
|
||||
#[error("Missing item dependency ({0} {1})")]
|
||||
MissingItem(&'static str, String),
|
||||
|
||||
#[error("Failed to parse {0} from '{1}'")]
|
||||
ParsingError(&'static str, String),
|
||||
|
||||
#[error("{0}")]
|
||||
Other(&'static str),
|
||||
}
|
||||
|
||||
/// Return type for database methods.
|
||||
pub type Result<T> = std::result::Result<T, Error>;
|
||||
Loading…
Add table
Add a link
Reference in a new issue