Skip to content

Commit

Permalink
Add more error context.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gohla committed Sep 18, 2023
1 parent 4832f25 commit 6ed212e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tutorial/stepper/src/modification.rs
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ impl CreateDiffAndApplyResolved {
stepper.apply_substitutions(&mut modified_text);

let destination_file_path = dunce::canonicalize(&self.destination_file_path)
.context(|| format!("failed to canonicalize destination file path '{}' for unified diff header", self.destination_file_path.display()))?;
.with_context(|| format!("failed to canonicalize destination file path '{}' for unified diff header", self.destination_file_path.display()))?;
let header_file_name = destination_file_path.strip_prefix(&stepper.destination_root_directory)
.with_context(|| format!("failed to get relative file name for unified diff header by stripping prefix '{}' from: {}", stepper.destination_root_directory.display(), destination_file_path.display()))?
.to_slash_lossy();
Expand Down

0 comments on commit 6ed212e

Please sign in to comment.