Skip to content

Commit

Permalink
Merge pull request containers#276 from cgwalters/errcontext-alongside
Browse files Browse the repository at this point in the history
install: Add more error contexts
  • Loading branch information
cgwalters authored Jan 19, 2024
2 parents ec59a16 + 1fda5c3 commit f8f3af1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/src/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1081,6 +1081,7 @@ fn installation_complete() {
}

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

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

let st = root_path.symlink_metadata()?;
let st = root_path
.symlink_metadata()
.with_context(|| format!("Querying target filesystem {root_path}"))?;
if !st.is_dir() {
anyhow::bail!("Not a directory: {root_path}");
}
Expand Down

0 comments on commit f8f3af1

Please sign in to comment.