Skip to content

Commit

Permalink
✨ Add download page redirects for errors opening VS
Browse files Browse the repository at this point in the history
  • Loading branch information
Lamparter authored Sep 1, 2024
1 parent 268bce2 commit de74fe0
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions src/FluentHub.App/UserControls/GitCloneFlyout.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,18 @@ private async void OpenVSButton_Click(object sender, RoutedEventArgs e)
}
else
{
Log.Error(openStudioUrl, "Something went wrong. Visual Studio is not installed or there was another unspecified error.");
Log.Error(openStudioUrl, "Something went wrong. Visual Studio is not installed or there was another unspecified error; opening appropriate download page instead");
// Open visual studio download page
var downloadUri = new Uri("https://visualstudio.microsoft.com/");
var downloadSuccess = await Windows.System.Launcher.LaunchUriAsync(downloadUri);
if (downloadSuccess)
{
Log.Write(Serilog.Events.LogEventLevel.Information, "Opened Visual Studio download page");
}
else
{
Log.Error("Unknown error opening VS download page.");
}
}
}

Expand All @@ -165,7 +176,18 @@ private async void OpenVSCodeButton_Click(object sender, RoutedEventArgs e)
}
else
{
Log.Error(openCodeUrl, "Something went wrong. Code is not installed or there was another unspecified error.");
Log.Error(openCodeUrl, "Something went wrong. Code is not installed or there was another unspecified error; opening the download page instead.");
// Open vscode download page
var downloadUri = new Uri("https://code.visualstudio.com/");
var downloadSuccess = await Windows.System.Launcher.LaunchUriAsync(downloadUri);
if (downloadSuccess)
{
Log.Write(Serilog.Events.LogEventLevel.Information, "Opened Visual Studio Code download page");
}
else
{
Log.Error("Unknown error opening VSCode download page.");
}
}
}

Expand Down

0 comments on commit de74fe0

Please sign in to comment.