This commit is contained in:
2025-11-02 09:31:01 +01:00
commit 455e144ffb
37 changed files with 4193 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
use thiserror::Error;
#[derive(Error, Debug)]
pub enum CoreError {
#[error("Configuration error: {0}")]
Config(String),
#[error("I/O error: {0}")]
Io(#[from] std::io::Error),
#[error("Database error: {0}")]
Database(String),
#[error("Validation error: {0}")]
Validation(String),
#[error("{0} not found with id: {1}")]
NotFound(String, uuid::Uuid),
#[error("Duplicate resource: {0}")]
Duplicate(String),
#[error("Authentication failed: {0}")]
Auth(String),
#[error("An unknown error occurred")]
Unknown,
}
pub type CoreResult<T> = Result<T, CoreError>;