summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cli/cache/node.rs9
-rw-r--r--cli/cache/parsed_source.rs7
2 files changed, 13 insertions, 3 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
}
}
diff --git a/cli/cache/parsed_source.rs b/cli/cache/parsed_source.rs
index b6a80e82e..461ac6dce 100644
--- a/cli/cache/parsed_source.rs
+++ b/cli/cache/parsed_source.rs
@@ -121,7 +121,12 @@ impl ParsedSourceCache {
) {
Ok(analyzer) => Box::new(analyzer),
Err(err) => {
- log::debug!("Could not create cached module analyzer. {:#}", err);
+ let file = self
+ .db_cache_path
+ .as_ref()
+ .map(|s| s.to_string_lossy().to_string())
+ .unwrap_or_default();
+ log::error!("Could not create cached module analyzer, cache file '{file}' may be corrupt: {:#}", err);
// fallback to not caching if it can't be created
Box::new(deno_graph::CapturingModuleAnalyzer::new(
None,