Skip to content

Commit

Permalink
catching exceptions occuring during check for last version and showin…
Browse files Browse the repository at this point in the history
…g release notes
  • Loading branch information
csoltenborn committed Aug 4, 2018
1 parent caac8ae commit 41ebb3e
Showing 1 changed file with 24 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.IO;
using System.Threading;
using GoogleTestAdapter.VsPackage.GTA.ReleaseNotes;
using GoogleTestAdapter.VsPackage.Helpers;

namespace GoogleTestAdapter.VsPackage
{
Expand All @@ -20,6 +21,27 @@ private void DisplayReleaseNotesIfNecessary()
}

private void DisplayReleaseNotesIfNecessaryProc()
{
try
{
TryDisplayReleaseNotesIfNecessary();
}
catch (Exception e)
{
string msg = $"Exception while trying to update last version and show release notes:{Environment.NewLine}{e}";
try
{
new ActivityLogLogger(this, () => true).LogError(msg);
}
catch (Exception)
{
// well...
Console.Error.WriteLine(msg);
}
}
}

private void TryDisplayReleaseNotesIfNecessary()
{
var versionProvider = new VersionProvider(this);

Expand All @@ -31,7 +53,8 @@ private void DisplayReleaseNotesIfNecessaryProc()
if ((_generalOptions.ShowReleaseNotes || History.ForceShowReleaseNotes(formerlyInstalledVersion)) &&
(formerlyInstalledVersion == null || formerlyInstalledVersion < currentVersion))
{
var creator = new ReleaseNotesCreator(formerlyInstalledVersion, currentVersion, Donations.IsPreDonationsVersion(formerlyInstalledVersion));
var creator = new ReleaseNotesCreator(formerlyInstalledVersion, currentVersion,
Donations.IsPreDonationsVersion(formerlyInstalledVersion));
DisplayReleaseNotes(creator.CreateHtml());
}
}
Expand Down

0 comments on commit 41ebb3e

Please sign in to comment.