diff options
-rw-r--r-- | src/download.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/download.rs b/src/download.rs index 82bb302..fa99ea5 100644 --- a/src/download.rs +++ b/src/download.rs @@ -36,7 +36,10 @@ pub(crate) async fn download(url: Uri, args: &Args) -> Result<(), Error> { response = client.get(location).await?; } if !response.status().is_success() { - bail!("non-success response code {} in URL {}", response.status(), url); + let status = response.status(); + let body = hyper::body::to_bytes(response.into_body()).await?; + let body = String::from_utf8_lossy(&body); + bail!("non-success response code {} in URL {}:\n{}\n", status, url, body); } let output_file_path = if let Some(path) = output_file_path { |