use thiserror::Error; #[derive(Error, Debug)] pub enum CoreError { #[error("Database error: {0}")] #[cfg(feature = "mongodb")] Database(#[from] mongodb::error::Error), #[error("Database error: {0}")] #[cfg(not(feature = "mongodb"))] Database(String), #[error("Serialization error: {0}")] Serialization(#[from] serde_json::Error), #[error("Git error: {0}")] Git(String), #[error("Scanner error: {source}")] Scanner { scanner: String, #[source] source: Box, }, #[error("LLM error: {0}")] Llm(String), #[error("Issue tracker error: {0}")] IssueTracker(String), #[error("HTTP error: {0}")] Http(String), #[error("Configuration error: {0}")] Config(String), #[error("IO error: {0}")] Io(#[from] std::io::Error), #[error("Not found: {0}")] NotFound(String), #[error("{0}")] Other(String), }