mirror of
https://github.com/johrpan/musicus.git
synced 2025-10-26 19:57:25 +01:00
Split into multiple crates
This commit is contained in:
parent
d7fb996183
commit
5d06ec9faf
88 changed files with 501 additions and 528 deletions
28
crates/musicus_backend/src/error.rs
Normal file
28
crates/musicus_backend/src/error.rs
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
/// An error that can happened within the backend.
|
||||
#[derive(thiserror::Error, Debug)]
|
||||
pub enum Error {
|
||||
#[error(transparent)]
|
||||
ClientError(#[from] musicus_client::Error),
|
||||
|
||||
#[error(transparent)]
|
||||
DatabaseError(#[from] musicus_database::Error),
|
||||
|
||||
#[error("An error happened using the SecretService.")]
|
||||
SecretServiceError(#[from] secret_service::Error),
|
||||
|
||||
#[error("An error happened in GLib.")]
|
||||
GlibError(#[from] glib::BoolError),
|
||||
|
||||
#[error("A channel was canceled.")]
|
||||
ChannelError(#[from] futures_channel::oneshot::Canceled),
|
||||
|
||||
#[error("An error happened while decoding to UTF-8.")]
|
||||
Utf8Error(#[from] std::str::Utf8Error),
|
||||
|
||||
#[error("An error happened: {0}")]
|
||||
Other(&'static str),
|
||||
}
|
||||
|
||||
|
||||
pub type Result<T> = std::result::Result<T, Error>;
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue