From 63c8cbae5bcc4338457b72a757e7e37af77dbedc Mon Sep 17 00:00:00 2001 From: Kerollmops Date: Mon, 13 Jan 2025 10:30:53 +0100 Subject: [PATCH] Improve the panic message when deleting an unknown entry --- crates/milli/src/update/new/indexer/write.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/milli/src/update/new/indexer/write.rs b/crates/milli/src/update/new/indexer/write.rs index fc647cfa5..01748cf0d 100644 --- a/crates/milli/src/update/new/indexer/write.rs +++ b/crates/milli/src/update/new/indexer/write.rs @@ -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) => {