mirror of
https://github.com/storytold/photocraft.git
synced 2026-11-12 21:23:02 +00:00
fix(atomic): the vanished-backup error names the path it looked at
This commit is contained in:
1 parent
30c617cc79
commit
82ee6ada2e
2 files changed
+6
-4
No files matched your search
@@ -511,9 +511,10 @@ pub(crate) fn unresolved_recovery_error(dest: &Path, completion: &io::Error, res
|
||||
let msg = if restoration.kind() == io::ErrorKind::NotFound {
|
||||
format!(
|
||||
"cannot save {}: the previous version moved to its backup name but {RECOVERY_UNRESOLVED} from it \
|
||||
(completing the save failed: {completion}; the backup no longer exists: {restoration}), \
|
||||
so the destination currently holds no file under that name",
|
||||
dest.display()
|
||||
(completing the save failed: {completion}; the backup {} no longer exists: {restoration}), \
|
||||
so the destination currently holds no file under that name — check whether it was moved",
|
||||
dest.display(),
|
||||
recovery.display()
|
||||
)
|
||||
} else {
|
||||
format!(
|
||||
|
||||
@@ -384,7 +384,8 @@ fn a_vanished_backup_is_reported_as_gone_rather_than_as_a_recovery_copy() {
|
||||
Path::new("/docs/.report.psd.9.pcsave.tmp"),
|
||||
);
|
||||
let msg = e.to_string();
|
||||
assert!(msg.contains("no longer exists") && msg.contains("no file under that name"), "{msg}");
|
||||
assert!(msg.contains(".report.psd.9.pcsave.tmp") && msg.contains("no longer exists"), "the vanished backup is named: {msg}");
|
||||
assert!(msg.contains("no file under that name"), "{msg}");
|
||||
assert!(!msg.contains("survives at"), "no recovery promise for a vanished backup: {msg}");
|
||||
assert!(!msg.contains("the original file was not changed"), "{msg}");
|
||||
}
|
||||
Reference in new issue
Block a user