2022-01-23 13:18:37 +01:00
|
|
|
/// An error that happened within the backend.
|
2021-02-04 21:47:22 +01:00
|
|
|
#[derive(thiserror::Error, Debug)]
|
|
|
|
|
pub enum Error {
|
|
|
|
|
#[error(transparent)]
|
|
|
|
|
DatabaseError(#[from] musicus_database::Error),
|
|
|
|
|
|
|
|
|
|
#[error("An error happened while decoding to UTF-8.")]
|
|
|
|
|
Utf8Error(#[from] std::str::Utf8Error),
|
|
|
|
|
|
2021-04-25 12:26:43 +02:00
|
|
|
#[error("Failed to receive an event.")]
|
|
|
|
|
RecvError(#[from] tokio::sync::broadcast::error::RecvError),
|
|
|
|
|
|
2021-02-04 21:47:22 +01:00
|
|
|
#[error("An error happened: {0}")]
|
2021-02-18 18:20:31 +01:00
|
|
|
Other(String),
|
2021-02-04 21:47:22 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pub type Result<T> = std::result::Result<T, Error>;
|