Skip to content

Commit

Permalink
Improve error message on file write error
Browse files Browse the repository at this point in the history
Will help to diagnose mitsuhiko#621
  • Loading branch information
max-sixty committed Oct 1, 2024
1 parent bf776f5 commit 24290a1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion insta/src/snapshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,8 @@ impl Snapshot {
}

let serialized_snapshot = self.serialize_snapshot(md);
fs::write(path, serialized_snapshot)?;
fs::write(path, serialized_snapshot)
.map_err(|e| content::Error::FileIo(e, path.to_path_buf()))?;
Ok(())
}

Expand Down

0 comments on commit 24290a1

Please sign in to comment.