summaryrefslogtreecommitdiff
path: root/cli/cache
diff options
context:
space:
mode:
Diffstat (limited to 'cli/cache')
-rw-r--r--cli/cache/mod.rs15
1 files changed, 10 insertions, 5 deletions
diff --git a/cli/cache/mod.rs b/cli/cache/mod.rs
index 58d4679d1..1d6a79963 100644
--- a/cli/cache/mod.rs
+++ b/cli/cache/mod.rs
@@ -274,14 +274,19 @@ impl Loader for FetchCacher {
}))
})
.unwrap_or_else(|err| {
- if let Some(err) = err.downcast_ref::<std::io::Error>() {
- if err.kind() == std::io::ErrorKind::NotFound {
+ if let Some(io_err) = err.downcast_ref::<std::io::Error>() {
+ if io_err.kind() == std::io::ErrorKind::NotFound {
return Ok(None);
+ } else {
+ return Err(err);
}
- } else if get_error_class_name(&err) == "NotFound" {
- return Ok(None);
}
- Err(err)
+ let error_class_name = get_error_class_name(&err);
+ match error_class_name {
+ "NotFound" => Ok(None),
+ "NotCached" if cache_setting == LoaderCacheSetting::Only => Ok(None),
+ _ => Err(err),
+ }
})
}
.boxed()