summaryrefslogtreecommitdiff
path: root/cli/cache/node.rs
diff options
context:
space:
mode:
authorMatt Mastracci <matthew@mastracci.com>2023-03-21 11:19:10 -0600
committerGitHub <noreply@github.com>2023-03-21 17:19:10 +0000
commit2ef8269fdb395b0736153ff5fbb9696cbb976e42 (patch)
treee21f13ca5c465b399929efc1a5f18cb2d137e0ef /cli/cache/node.rs
parent08849a48ca8f7d59cd7d2fc51dcc8ec02a216030 (diff)
fix(cli) Better error messages on corrupt databases that aren't automatically re-created (#18330)
Diffstat (limited to 'cli/cache/node.rs')
-rw-r--r--cli/cache/node.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/cli/cache/node.rs b/cli/cache/node.rs
index b19772229..2f1b1f55f 100644
--- a/cli/cache/node.rs
+++ b/cli/cache/node.rs
@@ -106,11 +106,16 @@ impl NodeAnalysisCache {
) {
Ok(cache) => Some(cache),
Err(err) => {
+ let file = self
+ .db_file_path
+ .as_ref()
+ .map(|s| s.to_string_lossy().to_string())
+ .unwrap_or_default();
+ log::error!("Error creating node analysis cache, file '{file}' may be corrupt: {:#}", err);
// should never error here, but if it ever does don't fail
if cfg!(debug_assertions) {
- panic!("Error creating node analysis cache: {err:#}");
+ panic!("Error creating node analysis cache, file '{file}' may be corrupt: {err:#}");
} else {
- log::debug!("Error creating node analysis cache: {:#}", err);
None
}
}