Files
Bedrock/crates/clusters/src/error.rs
T

36 lines
1.2 KiB
Rust

use thiserror::Error;
#[derive(Debug, Error)]
pub enum ConfigError {
#[error("invalid {0} name")]
Name(&'static str),
#[error("the selected database cluster is not configured")]
UnknownCluster,
#[error("a cluster must be selected when clusters are configured")]
ClusterRequired,
#[error("legacy cluster and sql.documents refer to different resources")]
ConflictingDocuments,
#[error("binding {role} references unknown resource {target}")]
UnknownBinding { role: String, target: String },
#[error("conflicting bindings for role {0}")]
ConflictingBinding(String),
#[error("invalid object storage configuration")]
ObjectStorage,
#[error("resource already exists")]
DuplicateResource,
#[error("resource does not exist")]
MissingResource,
#[error("resource is referenced by a deployment binding")]
ResourceInUse,
#[error("a resource update must preserve its category")]
ResourceCategory,
#[error("the database pool size must be greater than zero")]
PoolSize,
#[error("SQLite does not support a replica list")]
SqliteReplicas,
#[error("invalid SQLite file path")]
SqlitePath,
#[error("invalid {0} database URL")]
Url(&'static str),
}