Skip to content

Commit 12c9899

Browse files
authored
Improve error handling for 0 length downloads (#608)
Provides a better error message then the hash error seen in #604
1 parent 21a96dc commit 12c9899

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

WPILibInstaller-Avalonia/ViewModels/VSCodePageViewModel.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using System;
22
using System.IO;
3-
using System.IO.Compression;
43
using System.Reactive;
54
using System.Reactive.Linq;
65
using System.Security.Cryptography;
@@ -397,6 +396,11 @@ private async Task DownloadForPlatform(string downloadUrl, Stream outputStream,
397396
};
398397

399398
await client.StartDownload();
399+
400+
if (outputStream.Length == 0)
401+
{
402+
throw new Exception("0 bytes downloaded");
403+
}
400404
}
401405
catch (Exception ex)
402406
{

0 commit comments

Comments
 (0)