summaryrefslogtreecommitdiff
path: root/cli/cache/mod.rs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2023-09-18 10:46:44 -0400
committerGitHub <noreply@github.com>2023-09-18 10:46:44 -0400
commit0709c051f83c181206f6653396f5428df66ed74f (patch)
tree9360ce6cfc2c3f3f53a8a7af0f9d3bdc9e1ee553 /cli/cache/mod.rs
parent4fcd9a0de815a756e5f173e1bc1f84d90ba39ec7 (diff)
feat(unstable): package manager (#20517)
Adds an experimental unstable built-in package manager to Deno, but it is currently not usable because the registry infrastructure hasn't been setup and it points to a non-existent url by default. The default registry url can be configured via the `DENO_REGISTRY_URL` environment variable.
Diffstat (limited to 'cli/cache/mod.rs')
-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()