2023-02-11 17:59:15 +00:00
|
|
|
pub mod core;
|
|
|
|
pub mod database;
|
2023-03-02 04:54:23 +00:00
|
|
|
pub mod media;
|
2023-03-10 14:35:18 +00:00
|
|
|
pub mod playback;
|
2023-03-02 04:54:23 +00:00
|
|
|
pub mod scanner;
|
2023-02-11 17:59:15 +00:00
|
|
|
use database::DatabaseError;
|
|
|
|
use thiserror::Error;
|
|
|
|
|
2023-02-26 03:17:00 +00:00
|
|
|
#[derive(Debug, Error, PartialEq)]
|
2023-02-11 17:59:15 +00:00
|
|
|
pub enum Error {
|
|
|
|
#[error("Database error: {0}")]
|
|
|
|
DatabaseError(DatabaseError),
|
2023-03-10 14:35:18 +00:00
|
|
|
|
|
|
|
#[error("Cannot play track")]
|
2023-03-11 18:02:52 +00:00
|
|
|
CannotPlay(String),
|
2023-03-10 14:35:18 +00:00
|
|
|
|
|
|
|
#[error("Cannot stop playback")]
|
|
|
|
CannotStop,
|
|
|
|
|
|
|
|
#[error("Unmatched glib error: {0}")]
|
|
|
|
GlibError(gstreamer::glib::Error),
|
2023-02-11 17:59:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
impl From<DatabaseError> for Error {
|
|
|
|
fn from(err: DatabaseError) -> Self {
|
|
|
|
Self::DatabaseError(err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-02-26 03:17:00 +00:00
|
|
|
#[derive(Debug, Error, PartialEq)]
|
2023-02-11 17:59:15 +00:00
|
|
|
pub enum FatalError {
|
|
|
|
#[error("Unexpected error")]
|
|
|
|
UnexpectedError,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl flow::FatalError for FatalError {}
|