From 0709c051f83c181206f6653396f5428df66ed74f Mon Sep 17 00:00:00 2001 From: David Sherret Date: Mon, 18 Sep 2023 10:46:44 -0400 Subject: 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. --- cli/cache/mod.rs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'cli/cache') 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::() { - if err.kind() == std::io::ErrorKind::NotFound { + if let Some(io_err) = err.downcast_ref::() { + 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() -- cgit v1.2.3