Files
compliance-scanner-agent/compliance-core/src/error.rs
Sharang Parnerkar 37689d4661 Fix dashboard wasm build and feature-gate mongodb for wasm compatibility
- Feature-gate mongodb in compliance-core (optional, default on) so wasm
  builds don't pull in tokio/mio via mongodb
- Use bson v2 directly for ObjectId types (wasm-compatible)
- Restructure dashboard infrastructure/mod.rs: server function modules
  always compiled (for RPC stubs), server-only modules cfg-gated
- Remove reqwest from dashboard web feature (not needed, data flows
  through server functions)
- Add .gitignore

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 17:16:38 +01:00

47 lines
966 B
Rust

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<dyn std::error::Error + Send + Sync>,
},
#[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),
}