Skip to content
This repository was archived by the owner on Nov 1, 2023. It is now read-only.

Commit 0a10214

Browse files
authored
Return an error when download_input fails (#485)
1 parent 5acb59e commit 0a10214

File tree

1 file changed

+5
-2
lines changed
  • src/agent/onefuzz-agent/src/tasks

1 file changed

+5
-2
lines changed

src/agent/onefuzz-agent/src/tasks/utils.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
use anyhow::Result;
55
use async_trait::async_trait;
6-
use onefuzz::jitter::delay_with_jitter;
6+
use onefuzz::{http::ResponseExt, jitter::delay_with_jitter};
77
use reqwest::Url;
88
use std::path::{Path, PathBuf};
99
use std::time::Duration;
@@ -13,7 +13,10 @@ pub async fn download_input(input_url: Url, dst: impl AsRef<Path>) -> Result<Pat
1313
let file_name = input_url.path_segments().unwrap().last().unwrap();
1414
let file_path = dst.as_ref().join(file_name);
1515

16-
let resp = reqwest::get(input_url).await?;
16+
let resp = reqwest::get(input_url)
17+
.await?
18+
.error_for_status_with_body()
19+
.await?;
1720

1821
let body = resp.bytes().await?;
1922
let mut body = body.as_ref();

0 commit comments

Comments
 (0)