refactor: migrate all modules from anyhow to SunbeamError

Replace anyhow::{bail, Context, Result} with crate::error::{Result,
SunbeamError, ResultExt} across all modules. Each module uses the
appropriate error variant (Kube, Secrets, Build, Identity, etc).
This commit is contained in:
2026-03-20 13:15:45 +00:00
parent cc0b6a833e
commit 7fd8874d99
12 changed files with 163 additions and 160 deletions

View File

@@ -1,4 +1,4 @@
use anyhow::{bail, Result};
use crate::error::{Result, SunbeamError};
use clap::{Parser, Subcommand, ValueEnum};
/// Sunbeam local dev stack manager.
@@ -309,7 +309,7 @@ pub enum UserAction {
},
}
fn validate_date(s: &str) -> Result<String, String> {
fn validate_date(s: &str) -> std::result::Result<String, String> {
if s.is_empty() {
return Ok(s.to_string());
}
@@ -672,10 +672,10 @@ pub async fn dispatch() -> Result<()> {
Env::Production => {
let host = crate::config::get_production_host();
if host.is_empty() {
bail!(
return Err(SunbeamError::config(
"Production host not configured. \
Use `sunbeam config set --host` or set SUNBEAM_SSH_HOST."
);
Use `sunbeam config set --host` or set SUNBEAM_SSH_HOST.",
));
}
Some(host)
}