use thiserror::Error;
#[derive(Debug, Error)]
#[non_exhaustive]
pub enum TenantError {
#[error("namespace not found: {0}")]
NamespaceNotFound(String),
#[error("namespace already exists: {0}")]
NamespaceAlreadyExists(String),
#[error("quota exceeded for namespace '{namespace}': {resource} ({current}/{limit})")]
QuotaExceeded {
namespace: String,
resource: String,
current: u64,
limit: u64,
},
#[error("invalid namespace config: {0}")]
InvalidConfig(String),
#[error("schema error: {0}")]
Schema(#[from] chronix_core::SchemaError),
}
pub type Result<T> = std::result::Result<T, TenantError>;