1#[derive(Debug, thiserror::Error)]
8pub enum Error {
9 #[error("invalid auth root private key: {0}")]
12 AuthPrivKey(String),
13 #[error("invalid auth root public key: {0}")]
15 AuthPubKey(String),
16 #[error(
20 "refusing to bind {addr} with control-plane auth disabled: an \
21 unauthenticated control plane must not be exposed to a non-loopback \
22 address. Configure auth keys, bind a loopback address, or set the `dev` \
23 security profile / `allow_unauthenticated_public_bind` for local dev"
24 )]
25 UnauthenticatedPublicBind { addr: std::net::SocketAddr },
26
27 #[cfg(feature = "handlers")]
29 #[error("handlers SQL binding: env var {0} is not set")]
30 SqlEnvUnset(String),
31 #[cfg(feature = "handlers")]
33 #[error("handlers SQL binding: `url` (cluster sqld) requires `admin_url`")]
34 SqlAdminUrlRequired,
35 #[cfg(feature = "handlers")]
37 #[error("handlers SQL binding: unknown preview_mode {0:?} (expected empty | branch | shared)")]
38 UnknownPreviewMode(String),
39 #[cfg(feature = "handlers")]
41 #[error("handlers SQL binding: reading preview_init {path:?}: {source}")]
42 PreviewInitRead {
43 path: std::path::PathBuf,
44 #[source]
45 source: std::io::Error,
46 },
47 #[cfg(any(feature = "sql-postgres", feature = "sql-mysql"))]
49 #[error("handlers SQL binding: external database {name:?} has unknown kind {kind:?} (expected postgres | mysql)")]
50 SqlExternalKind { name: String, kind: String },
51 #[cfg(any(feature = "sql-postgres", feature = "sql-mysql"))]
53 #[error("handlers SQL binding: external database {0:?} is missing `url_env`")]
54 SqlExternalUrlEnvMissing(String),
55 #[cfg(any(feature = "sql-postgres", feature = "sql-mysql"))]
57 #[error("handlers SQL binding: external database {name:?}: {source}")]
58 SqlExternalConnect {
59 name: String,
60 #[source]
61 source: boatramp_core::sql::SqlError,
62 },
63 #[cfg(all(
66 feature = "handlers",
67 not(any(feature = "sql-postgres", feature = "sql-mysql"))
68 ))]
69 #[error("handlers SQL binding: external database {0:?} needs an external SQL engine — rebuild with --features sql-postgres and/or sql-mysql")]
70 SqlExternalUnavailable(String),
71
72 #[cfg(not(feature = "slatedb"))]
74 #[error("this build has no slatedb support; rebuild with `--features slatedb`")]
75 NoSlatedbSupport,
76 #[cfg(not(feature = "cloudflare-kv"))]
78 #[error("this build has no Cloudflare KV support; rebuild with `--features cloudflare-kv`")]
79 NoCloudflareKvSupport,
80 #[cfg(any(feature = "slatedb", feature = "cloudflare-kv"))]
82 #[error(transparent)]
83 Kv(#[from] boatramp_core::kv::KvError),
84
85 #[cfg(not(feature = "fs"))]
87 #[error("this build has no filesystem blob support; rebuild with `--features fs`")]
88 NoFsSupport,
89 #[cfg(not(feature = "s3"))]
91 #[error("this build has no S3 support; rebuild with `--features s3`")]
92 NoS3Support,
93 #[cfg(not(feature = "gcs"))]
95 #[error("this build has no GCS support; rebuild with `--features gcs`")]
96 NoGcsSupport,
97 #[cfg(not(feature = "azure"))]
99 #[error("this build has no Azure support; rebuild with `--features azure`")]
100 NoAzureSupport,
101 #[cfg(feature = "s3")]
103 #[error("--s3-bucket is required for --blobs s3")]
104 S3BucketRequired,
105 #[cfg(feature = "gcs")]
107 #[error("--gcs-bucket is required for --blobs gcs")]
108 GcsBucketRequired,
109 #[cfg(feature = "gcs")]
111 #[error("GCS backend: {0}")]
112 GcsConnect(String),
113 #[cfg(feature = "azure")]
115 #[error("--azure-account and --azure-container are required for --blobs azure")]
116 AzureConfigRequired,
117 #[cfg(feature = "azure")]
119 #[error("Azure backend: {0}")]
120 AzureConnect(String),
121
122 #[cfg(feature = "handlers")]
124 #[error(transparent)]
125 Handler(#[from] boatramp_handlers::HandlerError),
126}
127
128pub type Result<T> = std::result::Result<T, Error>;