Improve the panic message when deleting an unknown entry

This commit is contained in:
Kerollmops 2025-01-13 10:30:53 +01:00 committed by Louis Dureuil
parent 72ded27e98
commit 63c8cbae5b
No known key found for this signature in database

View File

@ -1,5 +1,6 @@
use std::sync::atomic::AtomicBool;
use bstr::ByteSlice as _;
use hashbrown::HashMap;
use heed::RwTxn;
use rand::SeedableRng as _;
@ -152,7 +153,10 @@ pub fn write_from_bbqueue(
}
(key, None) => match database.delete(wtxn, key) {
Ok(false) => {
unreachable!("We tried to delete an unknown key: {key:?}")
unreachable!(
"We tried to delete an unknown key from {database_name}: {:?}",
key.as_bstr()
)
}
Ok(_) => (),
Err(error) => {