1#[derive(Debug, thiserror::Error)]
8pub enum Error {
9 #[error("guest egress extra CA ({0})")]
14 GuestEgressCa(String),
15 #[error("invalid auth root private key: {0}")]
18 AuthPrivKey(String),
19 #[error("invalid auth root public key: {0}")]
21 AuthPubKey(String),
22 #[error(
26 "refusing to bind {addr} with control-plane auth disabled: an \
27 unauthenticated control plane must not be exposed to a non-loopback \
28 address. Configure auth keys, bind a loopback address, or set the `dev` \
29 security profile / `allow_unauthenticated_public_bind` for local dev"
30 )]
31 UnauthenticatedPublicBind { addr: std::net::SocketAddr },
32
33 #[cfg(feature = "handlers")]
35 #[error("handlers SQL binding: env var {0} is not set")]
36 SqlEnvUnset(String),
37 #[cfg(feature = "handlers")]
39 #[error("handlers SQL binding: `url` (cluster sqld) requires `admin_url`")]
40 SqlAdminUrlRequired,
41 #[cfg(feature = "handlers")]
43 #[error("handlers SQL binding: unknown preview_mode {0:?} (expected empty | branch | shared)")]
44 UnknownPreviewMode(String),
45 #[cfg(feature = "handlers")]
47 #[error("handlers SQL binding: reading preview_init {path:?}: {source}")]
48 PreviewInitRead {
49 path: std::path::PathBuf,
50 #[source]
51 source: std::io::Error,
52 },
53 #[cfg(any(feature = "sql-postgres", feature = "sql-mysql"))]
55 #[error("handlers SQL binding: external database {name:?} has unknown kind {kind:?} (expected postgres | mysql)")]
56 SqlExternalKind { name: String, kind: String },
57 #[cfg(any(feature = "sql-postgres", feature = "sql-mysql"))]
59 #[error("handlers SQL binding: external database {0:?} is missing `url_env`")]
60 SqlExternalUrlEnvMissing(String),
61 #[cfg(any(feature = "sql-postgres", feature = "sql-mysql"))]
63 #[error("handlers SQL binding: external database {name:?}: {source}")]
64 SqlExternalConnect {
65 name: String,
66 #[source]
67 source: boatramp_core::sql::SqlError,
68 },
69 #[cfg(any(feature = "sql-postgres", feature = "sql-mysql"))]
73 #[error(
74 "handlers SQL binding: managed database {0:?} needs a `[secrets]` envelope to seal its \
75 generated credential — set `[secrets]` (envelope = \"local\" or \"vault\"), or supply \
76 `password_env` to bring your own"
77 )]
78 SqlManagedNeedsSecrets(String),
79 #[cfg(any(feature = "sql-postgres", feature = "sql-mysql"))]
81 #[error("handlers SQL binding: managed database {name:?}: {reason}")]
82 SqlManagedCredential { name: String, reason: String },
83 #[cfg(all(
86 feature = "handlers",
87 not(any(feature = "sql-postgres", feature = "sql-mysql"))
88 ))]
89 #[error("handlers SQL binding: external database {0:?} needs an external SQL engine — rebuild with --features sql-postgres and/or sql-mysql")]
90 SqlExternalUnavailable(String),
91
92 #[cfg(not(feature = "slatedb"))]
94 #[error("this build has no slatedb support; rebuild with `--features slatedb`")]
95 NoSlatedbSupport,
96 #[cfg(not(feature = "cloudflare-kv"))]
98 #[error("this build has no Cloudflare KV support; rebuild with `--features cloudflare-kv`")]
99 NoCloudflareKvSupport,
100 #[cfg(any(feature = "slatedb", feature = "cloudflare-kv"))]
102 #[error(transparent)]
103 Kv(#[from] boatramp_core::kv::KvError),
104
105 #[cfg(not(feature = "fs"))]
107 #[error("this build has no filesystem blob support; rebuild with `--features fs`")]
108 NoFsSupport,
109 #[cfg(not(feature = "s3"))]
111 #[error("this build has no S3 support; rebuild with `--features s3`")]
112 NoS3Support,
113 #[cfg(not(feature = "gcs"))]
115 #[error("this build has no GCS support; rebuild with `--features gcs`")]
116 NoGcsSupport,
117 #[cfg(not(feature = "azure"))]
119 #[error("this build has no Azure support; rebuild with `--features azure`")]
120 NoAzureSupport,
121 #[cfg(feature = "s3")]
123 #[error("--s3-bucket is required for --blobs s3")]
124 S3BucketRequired,
125 #[cfg(feature = "gcs")]
127 #[error("--gcs-bucket is required for --blobs gcs")]
128 GcsBucketRequired,
129 #[cfg(feature = "gcs")]
131 #[error("GCS backend: {0}")]
132 GcsConnect(String),
133 #[cfg(feature = "azure")]
135 #[error("--azure-account and --azure-container are required for --blobs azure")]
136 AzureConfigRequired,
137 #[cfg(feature = "azure")]
139 #[error("Azure backend: {0}")]
140 AzureConnect(String),
141
142 #[cfg(feature = "handlers")]
144 #[error(transparent)]
145 Handler(#[from] boatramp_handlers::HandlerError),
146
147 #[error("secrets envelope: {0}")]
149 Envelope(String),
150}
151
152pub type Result<T> = std::result::Result<T, Error>;