1
0
Fork 0
mirror of https://codeberg.org/icewind/haze.git synced 2026-10-01 08:44:09 +02:00

feat(clean): Add more context to errors

Signed-off-by: Louis Chmn <louis@chmn.me>
This commit is contained in:
Louis Chmn 2026-09-20 11:16:10 +02:00
commit 28baa84262

View file

@ -93,8 +93,15 @@ async fn main() -> Result<ExitCode> {
clear_networks(&docker, &retain).await?;
for cache_dir in config.work_dir.read_dir().into_diagnostic()? {
let cache_dir = cache_dir.into_diagnostic()?;
for cache_dir in config
.work_dir
.read_dir()
.into_diagnostic()
.wrap_err_with(|| format!("Failed to read dir {}", config.work_dir))?
{
let cache_dir = cache_dir
.into_diagnostic()
.wrap_err_with(|| "Failed to unwrap cache_dir")?;
if let Some(id) = cache_dir.file_name().to_str()
&& id.starts_with("haze-")
&& !retain.iter().any(|cloud| cloud.id == id)
@ -117,7 +124,7 @@ async fn main() -> Result<ExitCode> {
}
}
prune_worktrees(&config)?;
prune_worktrees(&config).wrap_err_with(|| "Failed to prune worktree")?;
}
HazeArgs::List { filter } => {
let list = Cloud::list(&docker, filter, &config).await?;