Skip to main content

retro_core/
errors.rs

1use thiserror::Error;
2
3#[derive(Error, Debug)]
4pub enum CoreError {
5    #[error("IO error: {0}")]
6    Io(String),
7
8    #[error("Database error: {0}")]
9    Database(String),
10
11    #[error("Config error: {0}")]
12    Config(String),
13
14    #[error("Parse error: {0}")]
15    Parse(String),
16
17    #[error("Lock error: {0}")]
18    Lock(String),
19
20    #[error("Not initialized: {0}")]
21    NotInitialized(String),
22
23    #[error("Analysis error: {0}")]
24    Analysis(String),
25}
26
27impl From<rusqlite::Error> for CoreError {
28    fn from(e: rusqlite::Error) -> Self {
29        CoreError::Database(e.to_string())
30    }
31}