diff options
Diffstat (limited to 'cli/npm/cache.rs')
-rw-r--r-- | cli/npm/cache.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/cli/npm/cache.rs b/cli/npm/cache.rs index 5e6fb7ca8..f3436f7c0 100644 --- a/cli/npm/cache.rs +++ b/cli/npm/cache.rs @@ -210,7 +210,16 @@ impl NpmCache { if response.status() == 404 { bail!("Could not find npm package tarball at: {}", dist.tarball); } else if !response.status().is_success() { - bail!("Bad response: {:?}", response.status()); + let status = response.status(); + let maybe_response_text = response.text().await.ok(); + bail!( + "Bad response: {:?}{}", + status, + match maybe_response_text { + Some(text) => format!("\n\n{}", text), + None => String::new(), + } + ); } else { let bytes = response.bytes().await?; |