diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2022-08-25 20:24:18 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-25 20:24:18 -0400 |
commit | 376665d1154501660e7b20f760a0482509cff8b0 (patch) | |
tree | 0a979722c66f8ede48f1dff21c8ceb335521a94a /cli/npm/registry.rs | |
parent | 0fe590bbcbf270b50abd8d73db1c5e0be69591f1 (diff) |
fix: avoid global declaration collisions in cjs (#15608)
* Use a default stack size * 2 in debug for Windows because swc using so much stack size. We should look into this more later though.
Diffstat (limited to 'cli/npm/registry.rs')
-rw-r--r-- | cli/npm/registry.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/cli/npm/registry.rs b/cli/npm/registry.rs index 1604f4b11..ab7d81b75 100644 --- a/cli/npm/registry.rs +++ b/cli/npm/registry.rs @@ -302,7 +302,16 @@ impl NpmRegistryApi { if response.status() == 404 { Ok(None) } 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?; let package_info = serde_json::from_slice(&bytes)?; |