use cedar_policy::EntityTypeName;
use miette::Diagnostic;
use thiserror::Error;
use super::bitvec::BitVecError;
use super::ext::ExtError;
use super::extension_types::ipaddr::IPError;
#[derive(Debug, Diagnostic, Error)]
pub enum CompileError {
#[error("entity type {0} does not exist")]
NoSuchEntityType(EntityTypeName),
#[error("attribute {0} does not exist")]
NoSuchAttribute(String),
#[error("term type error")]
TypeError,
#[error("unsupported feature in SymCC: {0}")]
UnsupportedFeature(String),
#[error("bit-vector error: {0}")]
BitVecError(#[from] BitVecError),
#[error("IP address error: {0}")]
IPError(#[from] IPError),
#[error("context type is not a record")]
NonRecordContext,
#[error("extension error")]
ExtError(#[from] ExtError),
}