From d0bc8c755a2ab0da92b52021b9ef04881ecbb4fd 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/mod.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/milli/src/update/new/indexer/mod.rs b/crates/milli/src/update/new/indexer/mod.rs index 84d4af3b8..d4c4841bc 100644 --- a/crates/milli/src/update/new/indexer/mod.rs +++ b/crates/milli/src/update/new/indexer/mod.rs @@ -4,6 +4,7 @@ use std::sync::{OnceLock, RwLock}; use std::thread::{self, Builder}; use big_s::S; +use bstr::ByteSlice as _; use bumparaw_collections::RawMap; use document_changes::{extract, DocumentChanges, IndexingContext}; pub use document_deletion::DocumentDeletion; @@ -583,7 +584,10 @@ 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) => {