Skip to content

Commit 2f90eff

Browse files
authored
Merge pull request #1045 from cgwalters/ext-context
ostree-ext/encapsulate: Add some error contexts
2 parents 0d88682 + ded8a6b commit 2f90eff

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

ostree-ext/src/container/encapsulate.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -314,10 +314,11 @@ async fn build_impl(
314314
let (path, tag) = parse_oci_path_and_tag(dest.name.as_str());
315315
tracing::debug!("using OCI path={path} tag={tag:?}");
316316
if !Utf8Path::new(path).exists() {
317-
std::fs::create_dir(path)?;
317+
std::fs::create_dir(path).with_context(|| format!("Creating {path}"))?;
318318
}
319-
let ocidir = Dir::open_ambient_dir(path, cap_std::ambient_authority())?;
320-
let mut ocidir = OciDir::ensure(&ocidir)?;
319+
let ocidir = Dir::open_ambient_dir(path, cap_std::ambient_authority())
320+
.with_context(|| format!("Opening {path}"))?;
321+
let mut ocidir = OciDir::ensure(&ocidir).context("Opening OCI")?;
321322
build_oci(repo, ostree_ref, &mut ocidir, tag, config, opts)?;
322323
None
323324
} else {

0 commit comments

Comments
 (0)