fix(cli) Better error messages on corrupt databases that aren't automatically re-created (#18330)

This commit is contained in:
Matt Mastracci 2023-03-21 11:19:10 -06:00 committed by GitHub
parent 08849a48ca
commit 2ef8269fdb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 3 deletions

View file

@ -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,