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(
56 "handlers SQL binding: external database {name:?} has unknown kind {kind:?} (expected postgres | mysql)"
57 )]
58 SqlExternalKind { name: String, kind: String },
59 #[cfg(any(feature = "sql-postgres", feature = "sql-mysql"))]
61 #[error("handlers SQL binding: external database {0:?} is missing `url_env`")]
62 SqlExternalUrlEnvMissing(String),
63 #[cfg(any(feature = "sql-postgres", feature = "sql-mysql"))]
65 #[error("handlers SQL binding: external database {name:?}: {source}")]
66 SqlExternalConnect {
67 name: String,
68 #[source]
69 source: boatramp_core::sql::SqlError,
70 },
71 #[cfg(any(feature = "sql-postgres", feature = "sql-mysql"))]
75 #[error(
76 "handlers SQL binding: managed database {0:?} needs a `[secrets]` envelope to seal its \
77 generated credential — set `[secrets]` (envelope = \"local\" or \"vault\"), or supply \
78 `password_env` to bring your own"
79 )]
80 SqlManagedNeedsSecrets(String),
81 #[cfg(any(feature = "sql-postgres", feature = "sql-mysql"))]
83 #[error("handlers SQL binding: managed database {name:?}: {reason}")]
84 SqlManagedCredential { name: String, reason: String },
85 #[cfg(all(
88 feature = "handlers",
89 not(any(feature = "sql-postgres", feature = "sql-mysql"))
90 ))]
91 #[error(
92 "handlers SQL binding: external database {0:?} needs an external SQL engine — rebuild with --features sql-postgres and/or sql-mysql"
93 )]
94 SqlExternalUnavailable(String),
95
96 #[cfg(not(feature = "slatedb"))]
98 #[error("this build has no slatedb support; rebuild with `--features slatedb`")]
99 NoSlatedbSupport,
100 #[cfg(not(feature = "cloudflare-kv"))]
102 #[error("this build has no Cloudflare KV support; rebuild with `--features cloudflare-kv`")]
103 NoCloudflareKvSupport,
104 #[cfg(any(feature = "slatedb", feature = "cloudflare-kv"))]
106 #[error(transparent)]
107 Kv(#[from] boatramp_core::kv::KvError),
108
109 #[cfg(not(feature = "fs"))]
111 #[error("this build has no filesystem blob support; rebuild with `--features fs`")]
112 NoFsSupport,
113 #[cfg(not(feature = "s3"))]
115 #[error("this build has no S3 support; rebuild with `--features s3`")]
116 NoS3Support,
117 #[cfg(not(feature = "gcs"))]
119 #[error("this build has no GCS support; rebuild with `--features gcs`")]
120 NoGcsSupport,
121 #[cfg(not(feature = "azure"))]
123 #[error("this build has no Azure support; rebuild with `--features azure`")]
124 NoAzureSupport,
125 #[cfg(feature = "s3")]
127 #[error("--s3-bucket is required for --blobs s3")]
128 S3BucketRequired,
129 #[cfg(feature = "gcs")]
131 #[error("--gcs-bucket is required for --blobs gcs")]
132 GcsBucketRequired,
133 #[cfg(feature = "gcs")]
135 #[error("GCS backend: {0}")]
136 GcsConnect(String),
137 #[cfg(feature = "azure")]
139 #[error("--azure-account and --azure-container are required for --blobs azure")]
140 AzureConfigRequired,
141 #[cfg(feature = "azure")]
143 #[error("Azure backend: {0}")]
144 AzureConnect(String),
145
146 #[cfg(feature = "handlers")]
148 #[error(transparent)]
149 Handler(#[from] boatramp_handlers::HandlerError),
150
151 #[error("secrets envelope: {0}")]
153 Envelope(String),
154}
155
156pub type Result<T> = std::result::Result<T, Error>;