Skip to content

Commit

Permalink
Merge #2995 Don't report an unknown error if it is known
Browse files Browse the repository at this point in the history
  • Loading branch information
HebaruSan committed Feb 10, 2020
2 parents e9bf033 + 841a55e commit 46227a3
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ All notable changes to this project will be documented in this file.

### Bugfixes

- [GUI] Don't report an unknown error if it is known (#2995 by: DasSkelett; reviewed: HebaruSan)

### Internal

## v1.27.0
Expand Down
2 changes: 1 addition & 1 deletion GUI/Main/MainChangeset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ private void Changeset_OnConfirmChanges()
{
menuStrip1.Enabled = false;

//Using the changeset passed in can cause issues with versions.
// Using the changeset passed in can cause issues with versions.
// An example is Mechjeb for FAR at 25/06/2015 with a 1.0.2 install.
// TODO Work out why this is.
installWorker.RunWorkerAsync(
Expand Down
16 changes: 13 additions & 3 deletions GUI/Main/MainInstall.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ public partial class Main
{
private BackgroundWorker installWorker;

// used to signal the install worker that the user canceled the install process
// this may happen on the recommended/suggested mods dialogs
// Used to signal the install worker that the user canceled the install process.
// This may happen on the recommended/suggested mods dialogs or during the download.
private volatile bool installCanceled;

/// <summary>
Expand Down Expand Up @@ -417,9 +417,19 @@ private void PostInstallMods(object sender, RunWorkerCompletedEventArgs e)
);
}
}
else if (e.Error == null)
{
// The install was unsuccessful, but we did catch the exception.
FailWaitDialog(
Properties.Resources.MainInstallErrorInstalling,
Properties.Resources.MainInstallKnownError,
Properties.Resources.MainInstallFailed,
result.Key
);
}
else
{
// There was an error
// An unknown error was thrown which we didn't catch.
FailWaitDialog(
Properties.Resources.MainInstallErrorInstalling,
Properties.Resources.MainInstallUnknownError,
Expand Down
3 changes: 3 additions & 0 deletions GUI/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions GUI/Properties/Resources.de-DE.resx
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,9 @@ Einstellungen jetzt öffnen?</value>
<data name="MainInstallInstallCanceled" xml:space="preserve"><value>(De-)Installation/Aktualisierung abgebrochen!</value></data>
<data name="MainInstallErrorInstalling" xml:space="preserve"><value>Fehler bei der Installation!</value></data>
<data name="MainInstallUnknownError" xml:space="preserve"><value>Ein unbekannter Fehler ist aufgetreten, bitte versuche es erneut!</value></data>
<data name="MainInstallKnownError" xml:space="preserve"><value>Falls die Fehlermeldung ein Download-Problem andeutet, versuche es bitte erneut. Andernfalls melde bitte den Fehler bei uns.
Wenn du ein Fehler mit den Mod-Metadaten vermutest: https://github.com/KSP-CKAN/NetKAN/new/choose
Wenn du ein Fehler mit dem CKAN Client vermutest: https://github.com/KSP-CKAN/CKAN/new/choose</value></data>
<data name="MainInstallFailed" xml:space="preserve"><value>Installation fehlgeschlagen!</value></data>
<data name="MainInstallProvidedBy" xml:space="preserve"><value>Modul {0} wird von mehr als einem verfügbaren Modul bereitgestellt, bitte wähle eine der folgenden Mods:</value></data>
<data name="ModInfoVirtual" xml:space="preserve"><value>{0} (virtuell)</value></data>
Expand Down
3 changes: 3 additions & 0 deletions GUI/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,9 @@ Open settings now?</value></data>
<data name="MainInstallInstallCanceled" xml:space="preserve"><value>(Un)Install/Upgrade canceled!</value></data>
<data name="MainInstallErrorInstalling" xml:space="preserve"><value>Error during installation!</value></data>
<data name="MainInstallUnknownError" xml:space="preserve"><value>An unknown error occurred, please try again!</value></data>
<data name="MainInstallKnownError" xml:space="preserve"><value>If the above message indicates a download error, please try again. Otherwise, please open a issue for us to investigate.
If you suspect a metadata problem: https://github.com/KSP-CKAN/NetKAN/issues/new/choose
If you suspect a bug in the client: https://github.com/KSP-CKAN/CKAN/issues/new/choose</value></data>
<data name="MainInstallFailed" xml:space="preserve"><value>Installation failed!</value></data>
<data name="MainInstallProvidedBy" xml:space="preserve"><value>Module {0} is provided by more than one available module, please choose one of the following mods:</value></data>
<data name="ModInfoNSlashA" xml:space="preserve"><value>N/A</value></data>
Expand Down

0 comments on commit 46227a3

Please sign in to comment.