use thiserror::Error;
#[derive(Debug, Error)]
pub enum AcgError {
#[error("invalid intent: {0}")]
InvalidIntent(String),
#[error("serialization error: {0}")]
Serialization(#[from] serde_json::Error),
#[error("internal error: {0}")]
Internal(String),
#[error("plugin already registered: {0}")]
PluginAlreadyRegistered(String),
#[error("plugin not found: {0}")]
PluginNotFound(String),
#[error("plugin translation error: {0}")]
TranslationFailed(String),
#[error("IR construction error: {0}")]
IrConstructionError(String),
}
pub type Result<T> = std::result::Result<T, AcgError>;
#[cfg(test)]
#[path = "../../tests/unit/acg/error_tests.rs"]
mod tests;