refactor: add thiserror error tree and tracing logging

SunbeamError enum with typed variants (Kube, Config, Network, Secrets,
Build, Identity, ExternalTool, Io, Json, Yaml, Other) each mapping to
a process exit code. ResultExt trait replaces anyhow's .context().

main.rs initializes tracing-subscriber with RUST_LOG env filter and
routes all errors to exit codes via SunbeamError::exit_code().

Removes anyhow dependency.
This commit is contained in:
2026-03-20 13:15:26 +00:00
parent ec235685bf
commit cc0b6a833e
4 changed files with 457 additions and 11 deletions

View File

@@ -6,12 +6,14 @@ description = "Sunbeam local dev stack manager"
[dependencies]
# Core
anyhow = "1"
thiserror = "2"
tokio = { version = "1", features = ["full"] }
clap = { version = "4", features = ["derive"] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
serde_yaml = "0.9"
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
# Kubernetes
kube = { version = "0.99", features = ["client", "runtime", "derive", "ws"] }