diff options
Diffstat (limited to 'cli/file_fetcher.rs')
-rw-r--r-- | cli/file_fetcher.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/cli/file_fetcher.rs b/cli/file_fetcher.rs index 03b4a9d02..18c9cbf8a 100644 --- a/cli/file_fetcher.rs +++ b/cli/file_fetcher.rs @@ -1,5 +1,4 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. -use crate::deno_error::too_many_redirects; use crate::deno_error::DenoError; use crate::deno_error::ErrorKind; use crate::deno_error::GetErrorKind; @@ -107,7 +106,7 @@ impl SourceFileFetcher { if !SUPPORTED_URL_SCHEMES.contains(&url.scheme()) { return Err( DenoError::new( - ErrorKind::UnsupportedFetchScheme, + ErrorKind::Other, format!("Unsupported scheme \"{}\" for module \"{}\". Supported schemes: {:#?}", url.scheme(), url, SUPPORTED_URL_SCHEMES), ).into() ); @@ -358,7 +357,8 @@ impl SourceFileFetcher { redirect_limit: i64, ) -> Pin<Box<SourceFileFuture>> { if redirect_limit < 0 { - return futures::future::err(too_many_redirects()).boxed(); + let e = DenoError::new(ErrorKind::Http, "too many redirects".to_string()); + return futures::future::err(e.into()).boxed(); } let is_blacklisted = @@ -1295,7 +1295,7 @@ mod tests { .map(move |result| { assert!(result.is_err()); let err = result.err().unwrap(); - assert_eq!(err.kind(), ErrorKind::TooManyRedirects); + assert_eq!(err.kind(), ErrorKind::Http); }); tokio_util::run(fut); @@ -1571,7 +1571,7 @@ mod tests { SourceFileFetcher::check_if_supported_scheme(&url) .unwrap_err() .kind(), - ErrorKind::UnsupportedFetchScheme + ErrorKind::Other ); } } |