Skip to main content

gen_core/
errors.rs

1use thiserror::Error;
2
3#[derive(Debug, Error, PartialEq)]
4pub enum ConfigError {
5    #[error("Failed to find Gen directory")]
6    GenDirectoryNotFound,
7    #[error("Unable to determine repository root")]
8    RepoRootNotFound,
9}
10
11#[derive(Debug, Error, PartialEq)]
12pub enum ConnectionError {
13    #[error("Failed to open database connection: {0}")]
14    OpenFailed(#[from] rusqlite::Error),
15    #[error("Database tracking error: {0}")]
16    DatabaseTracking(String),
17    #[error("Config Error: {0}")]
18    ConfigError(#[from] ConfigError),
19}
20
21#[derive(Debug, Error, PartialEq)]
22pub enum StrandError {
23    #[error("Invalid Strand: {0}")]
24    InvalidStrand(String),
25    #[error("Rusqlite Error: {0}")]
26    SqliteError(#[from] rusqlite::Error),
27}