Skip to content

Commit f8f3af1

Browse files
authored
Merge pull request #276 from cgwalters/errcontext-alongside
install: Add more error contexts
2 parents ec59a16 + 1fda5c3 commit f8f3af1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/src/install.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1081,6 +1081,7 @@ fn installation_complete() {
10811081
}
10821082

10831083
/// Implementation of the `bootc install to-disk` CLI command.
1084+
#[context("Installing to disk")]
10841085
pub(crate) async fn install_to_disk(opts: InstallToDiskOpts) -> Result<()> {
10851086
let mut block_opts = opts.block_opts;
10861087
let target_blockdev_meta = block_opts
@@ -1197,11 +1198,14 @@ fn clean_boot_directories(rootfs: &Dir) -> Result<()> {
11971198
}
11981199

11991200
/// Implementation of the `bootc install to-filsystem` CLI command.
1201+
#[context("Installing to filesystem")]
12001202
pub(crate) async fn install_to_filesystem(opts: InstallToFilesystemOpts) -> Result<()> {
12011203
let fsopts = opts.filesystem_opts;
12021204
let root_path = &fsopts.root_path;
12031205

1204-
let st = root_path.symlink_metadata()?;
1206+
let st = root_path
1207+
.symlink_metadata()
1208+
.with_context(|| format!("Querying target filesystem {root_path}"))?;
12051209
if !st.is_dir() {
12061210
anyhow::bail!("Not a directory: {root_path}");
12071211
}

0 commit comments

Comments
 (0)