Move crates to toplevel directory

This commit is contained in:
Elias Projahn 2021-02-07 12:53:25 +01:00
parent d16961efa8
commit 0ffe68e04f
127 changed files with 15 additions and 13 deletions

24
database/src/error.rs Normal file
View 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(transparent)]
SendError(#[from] std::sync::mpsc::SendError<super::thread::Action>),
#[error(transparent)]
ReceiveError(#[from] futures_channel::oneshot::Canceled),
#[error("Database error: {0}")]
Other(String),
}
/// Return type for database methods.
pub type Result<T> = std::result::Result<T, Error>;