Add param to EntryAlreadyBorrowed error

This commit is contained in:
Matthias Beyer 2017-09-09 21:36:35 +02:00
parent a28613b889
commit 83f9350d98
2 changed files with 4 additions and 4 deletions

View File

@ -138,9 +138,9 @@ error_chain! {
display("The internal Store Lock has been poisoned")
}
EntryAlreadyBorrowed {
EntryAlreadyBorrowed(id: StoreId) {
description("Entry is already borrowed")
display("Entry is already borrowed")
display("Entry is already borrowed: {:?}", id)
}
EntryAlreadyExists {

View File

@ -173,7 +173,7 @@ impl StoreEntry {
Err(err)
})
} else {
Err(SE::from_kind(SEK::EntryAlreadyBorrowed))
Err(SE::from_kind(SEK::EntryAlreadyBorrowed(self.id.clone())))
}
}
@ -748,7 +748,7 @@ impl Store {
// if we have one, but it is borrowed, we really should not rename it, as this might
// lead to strange errors
if hsmap.get(&old_id).map(|e| e.is_borrowed()).unwrap_or(false) {
return Err(SE::from_kind(SEK::EntryAlreadyBorrowed));
return Err(SE::from_kind(SEK::EntryAlreadyBorrowed(old_id.clone())));
}
let old_id_pb = try!(old_id.clone().with_base(self.path().clone()).into_pathbuf());