From 1f6d1de62d718869d10da8c2a07eb2ee3b436b75 Mon Sep 17 00:00:00 2001 From: Yuya Nishihara Date: Sat, 10 Feb 2024 15:29:21 +0900 Subject: [PATCH] index: on reindexing, print error details to stderr It's not ideal to print the error there, but using stderr should be slightly better. It could be a tracing message, but tracing won't be displayed by default. --- lib/src/default_index/store.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/default_index/store.rs b/lib/src/default_index/store.rs index ee96793a13..0ac974176f 100644 --- a/lib/src/default_index/store.rs +++ b/lib/src/default_index/store.rs @@ -331,7 +331,7 @@ impl IndexStore for DefaultIndexStore { // If the index was corrupt (maybe it was written in a different format), // we just reindex. // TODO: Move this message to a callback or something. - println!("The index was corrupt (maybe the format has changed). Reindexing..."); + eprintln!("{err}: {source}. Reindexing...", source = err.error); self.reinit().map_err(|err| IndexReadError(err.into()))?; self.build_index_segments_at_operation(op, store) }