Skip to content

Commit

Permalink
Prevent error crash Driver Store Explorer
Browse files Browse the repository at this point in the history
  • Loading branch information
lostindark committed Aug 14, 2020
1 parent 4cff572 commit 346f6b8
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Rapr/DSEForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ private async void ButtonEnumerate_Click(object sender, EventArgs e)
await this.PopulateUIWithDriverStoreEntries().ConfigureAwait(true);
}

[System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "<Pending>")]
private async Task PopulateUIWithDriverStoreEntries()
{
try
Expand All @@ -302,6 +303,10 @@ private async Task PopulateUIWithDriverStoreEntries()
this.UpdateColumnSize();
this.ShowStatus(Status.Normal, Language.Status_Label);
}
catch (Exception ex)
{
this.ShowStatus(Status.Error, ex.Message, ex.ToString(), true);
}
finally
{
this.lstDriverStoreEntries.EmptyListMsg = Language.Message_No_Entries;
Expand Down Expand Up @@ -370,6 +375,7 @@ private async Task DeleteDriverStoreEntries(List<DriverStoreEntry> driverStoreEn
}
}

[System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "<Pending>")]
private async Task DeleteDriverStorePackages(List<DriverStoreEntry> driverStoreEntries)
{
StringBuilder details = new StringBuilder();
Expand Down Expand Up @@ -485,12 +491,17 @@ private async Task DeleteDriverStorePackages(List<DriverStoreEntry> driverStoreE

this.cbForceDeletion.Checked = false;
}
catch (Exception ex)
{
this.ShowStatus(Status.Error, ex.Message, ex.ToString(), true);
}
finally
{
this.EndOperation();
}
}

[System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "<Pending>")]
private async void ButtonAddDriver_Click(object sender, EventArgs e)
{
DialogResult dr = this.openFileDialog.ShowDialog();
Expand Down Expand Up @@ -528,6 +539,10 @@ private async void ButtonAddDriver_Click(object sender, EventArgs e)

this.cbAddInstall.Checked = false;
}
catch (Exception ex)
{
this.ShowStatus(Status.Error, ex.Message, ex.ToString(), true);
}
finally
{
this.EndOperation();
Expand Down

0 comments on commit 346f6b8

Please sign in to comment.