Skip to content

Commit 8f03ceb

Browse files
authored
made ReqwestReader error for status (#80)
1 parent 960e4e1 commit 8f03ceb

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/reader.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,12 @@ impl AsyncFileReader for ReqwestReader {
187187
// HTTP range is inclusive, so we need to subtract 1 from the end
188188
let range = format!("bytes={}-{}", range.start, range.end - 1);
189189
async move {
190-
let response = client.get(url).header("Range", range).send().await?;
190+
let response = client
191+
.get(url)
192+
.header("Range", range)
193+
.send()
194+
.await?
195+
.error_for_status()?;
191196
let bytes = response.bytes().await?;
192197
Ok(bytes)
193198
}

0 commit comments

Comments
 (0)