return correct error on failed os download (#1636)

This commit is contained in:
Aiden McClelland
2022-07-12 12:48:18 -06:00
committed by GitHub
parent 50e7b479b5
commit ac30ab223b

View File

@@ -356,7 +356,12 @@ async fn write_stream_to_label<Db: DbHandle>(
pin!(stream_download);
let mut downloaded = 0;
let mut last_progress_update = Instant::now();
while let Some(Ok(item)) = stream_download.next().await {
while let Some(item) = stream_download
.next()
.await
.transpose()
.with_kind(ErrorKind::Network)?
{
file.write_all(&item)
.await
.with_kind(ErrorKind::Filesystem)?;