mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-04-21 10:01:27 -07:00
Add proper error message for failed checksum on package download
This commit is contained in:
parent
460ff56279
commit
b2cfeeb7af
@ -159,7 +159,13 @@ namespace Bloxstrap
|
|||||||
if (connectionResult is not null)
|
if (connectionResult is not null)
|
||||||
{
|
{
|
||||||
Logger.WriteException(LOG_IDENT, connectionResult);
|
Logger.WriteException(LOG_IDENT, connectionResult);
|
||||||
Frontend.ShowConnectivityDialog("Roblox", Bloxstrap.Resources.Strings.Bootstrapper_Connectivity_Preventing, connectionResult);
|
|
||||||
|
Frontend.ShowConnectivityDialog(
|
||||||
|
Bloxstrap.Resources.Strings.Dialog_Connectivity_UnableToConnect,
|
||||||
|
Bloxstrap.Resources.Strings.Bootstrapper_Connectivity_Preventing,
|
||||||
|
connectionResult
|
||||||
|
);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -154,7 +154,7 @@ namespace Bloxstrap
|
|||||||
else if (ex.GetType() == typeof(AggregateException))
|
else if (ex.GetType() == typeof(AggregateException))
|
||||||
ex = ex.InnerException!;
|
ex = ex.InnerException!;
|
||||||
|
|
||||||
Frontend.ShowConnectivityDialog("Roblox", message, ex);
|
Frontend.ShowConnectivityDialog(Strings.Dialog_Connectivity_UnableToConnect, message, ex);
|
||||||
|
|
||||||
App.Terminate(ErrorCode.ERROR_CANCELLED);
|
App.Terminate(ErrorCode.ERROR_CANCELLED);
|
||||||
}
|
}
|
||||||
@ -1461,7 +1461,7 @@ namespace Bloxstrap
|
|||||||
string hash = MD5Hash.FromStream(fileStream);
|
string hash = MD5Hash.FromStream(fileStream);
|
||||||
|
|
||||||
if (hash != package.Signature)
|
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.");
|
throw new ChecksumFailedException($"Failed to verify download of {packageUrl}\n\nExpected hash: {package.Signature}\nGot hash: {hash}");
|
||||||
|
|
||||||
App.Logger.WriteLine(LOG_IDENT, $"Finished downloading! ({totalBytesRead} bytes total)");
|
App.Logger.WriteLine(LOG_IDENT, $"Finished downloading! ({totalBytesRead} bytes total)");
|
||||||
break;
|
break;
|
||||||
@ -1471,7 +1471,17 @@ namespace Bloxstrap
|
|||||||
App.Logger.WriteLine(LOG_IDENT, $"An exception occurred after downloading {totalBytesRead} bytes. ({i}/{maxTries})");
|
App.Logger.WriteLine(LOG_IDENT, $"An exception occurred after downloading {totalBytesRead} bytes. ({i}/{maxTries})");
|
||||||
App.Logger.WriteException(LOG_IDENT, ex);
|
App.Logger.WriteException(LOG_IDENT, ex);
|
||||||
|
|
||||||
if (i >= maxTries || ex.GetType() == typeof(ChecksumFailedException))
|
if (ex.GetType() == typeof(ChecksumFailedException))
|
||||||
|
{
|
||||||
|
Frontend.ShowConnectivityDialog(
|
||||||
|
Strings.Dialog_Connectivity_UnableToDownload,
|
||||||
|
String.Format(Strings.Dialog_Connectivity_UnableToDownloadReason, "[https://github.com/pizzaboxer/bloxstrap/wiki/Bloxstrap-is-unable-to-download-Roblox](https://github.com/pizzaboxer/bloxstrap/wiki/Bloxstrap-is-unable-to-download-Roblox)"),
|
||||||
|
ex
|
||||||
|
);
|
||||||
|
|
||||||
|
App.Terminate(ErrorCode.ERROR_CANCELLED);
|
||||||
|
}
|
||||||
|
else if (i >= maxTries)
|
||||||
throw;
|
throw;
|
||||||
|
|
||||||
if (File.Exists(packageLocation))
|
if (File.Exists(packageLocation))
|
||||||
|
20
Bloxstrap/Resources/Strings.Designer.cs
generated
20
Bloxstrap/Resources/Strings.Designer.cs
generated
@ -622,7 +622,7 @@ namespace Bloxstrap.Resources {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Bloxstrap is unable to connect to {0}.
|
/// Looks up a localized string similar to Bloxstrap is unable to connect to Roblox.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static string Dialog_Connectivity_UnableToConnect {
|
public static string Dialog_Connectivity_UnableToConnect {
|
||||||
get {
|
get {
|
||||||
@ -630,6 +630,24 @@ namespace Bloxstrap.Resources {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to Bloxstrap is unable to download Roblox.
|
||||||
|
/// </summary>
|
||||||
|
public static string Dialog_Connectivity_UnableToDownload {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("Dialog.Connectivity.UnableToDownload", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to Roblox cannot be downloaded at this time. Please read the following help page for more information: {0}.
|
||||||
|
/// </summary>
|
||||||
|
public static string Dialog_Connectivity_UnableToDownloadReason {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("Dialog.Connectivity.UnableToDownloadReason", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Copy log contents.
|
/// Looks up a localized string similar to Copy log contents.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -310,7 +310,7 @@ Click for more information</value>
|
|||||||
<value>Connectivity error</value>
|
<value>Connectivity error</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Dialog.Connectivity.UnableToConnect" xml:space="preserve">
|
<data name="Dialog.Connectivity.UnableToConnect" xml:space="preserve">
|
||||||
<value>Bloxstrap is unable to connect to {0}</value>
|
<value>Bloxstrap is unable to connect to Roblox</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Dialog.Exception.CopyLogContents" xml:space="preserve">
|
<data name="Dialog.Exception.CopyLogContents" xml:space="preserve">
|
||||||
<value>Copy log contents</value>
|
<value>Copy log contents</value>
|
||||||
@ -1061,4 +1061,10 @@ Scroll for more languages.</value>
|
|||||||
<data name="Menu.FastFlags.Presets.DisableTerrainTextures.Title" xml:space="preserve">
|
<data name="Menu.FastFlags.Presets.DisableTerrainTextures.Title" xml:space="preserve">
|
||||||
<value>Disable terrain textures</value>
|
<value>Disable terrain textures</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Dialog.Connectivity.UnableToDownload" xml:space="preserve">
|
||||||
|
<value>Bloxstrap is unable to download Roblox</value>
|
||||||
|
</data>
|
||||||
|
<data name="Dialog.Connectivity.UnableToDownloadReason" xml:space="preserve">
|
||||||
|
<value>Roblox cannot be downloaded at this time. Please read the following help page for more information: {0}</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
Loading…
Reference in New Issue
Block a user