mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-06-23 23:00:23 -07:00
debug packages not downloading properly over http
This commit is contained in:
parent
680f6dfda3
commit
63b91efe39
@ -1366,8 +1366,10 @@ namespace Bloxstrap
|
||||
UpdateProgressBar();
|
||||
}
|
||||
|
||||
if (MD5Hash.FromStream(fileStream) != package.Signature)
|
||||
throw new Exception("Signature does not match!");
|
||||
string hash = MD5Hash.FromStream(fileStream);
|
||||
|
||||
if (hash != package.Signature)
|
||||
throw new ChecksumFailedException($"Failed to verify download of {packageUrl}\n\nGot signature: {hash}\n\nPackage has been downloaded to {packageLocation}\n\nPlease send the file shown above in a bug report.");
|
||||
|
||||
App.Logger.WriteLine(LOG_IDENT, $"Finished downloading! ({totalBytesRead} bytes total)");
|
||||
break;
|
||||
@ -1377,12 +1379,12 @@ namespace Bloxstrap
|
||||
App.Logger.WriteLine(LOG_IDENT, $"An exception occurred after downloading {totalBytesRead} bytes. ({i}/{maxTries})");
|
||||
App.Logger.WriteException(LOG_IDENT, ex);
|
||||
|
||||
if (i >= maxTries || ex.GetType() == typeof(ChecksumFailedException))
|
||||
throw;
|
||||
|
||||
if (File.Exists(packageLocation))
|
||||
File.Delete(packageLocation);
|
||||
|
||||
if (i >= maxTries)
|
||||
throw;
|
||||
|
||||
_totalDownloadedBytes -= totalBytesRead;
|
||||
UpdateProgressBar();
|
||||
|
||||
|
15
Bloxstrap/Exceptions/ChecksumFailedException.cs
Normal file
15
Bloxstrap/Exceptions/ChecksumFailedException.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Bloxstrap.Exceptions
|
||||
{
|
||||
internal class ChecksumFailedException : Exception
|
||||
{
|
||||
public ChecksumFailedException(string message) : base(message)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user