Catch exceptions when attempting to launch the web browser

* Related: #1223
This commit is contained in:
ds5678 2024-02-28 00:28:24 -05:00
parent f423c9ed7a
commit be4e38218e

View File

@ -240,17 +240,24 @@ public static class WebApplicationLauncher
private static void OpenUrl(string url)
{
if (OperatingSystem.IsWindows())
try
{
Process.Start(new ProcessStartInfo(url) { UseShellExecute = true });
if (OperatingSystem.IsWindows())
{
Process.Start(new ProcessStartInfo(url) { UseShellExecute = true });
}
else if (OperatingSystem.IsLinux())
{
Process.Start("xdg-open", url);
}
else if (OperatingSystem.IsMacOS())
{
Process.Start("open", url);
}
}
else if (OperatingSystem.IsLinux())
catch (Exception ex)
{
Process.Start("xdg-open", url);
}
else if (OperatingSystem.IsMacOS())
{
Process.Start("open", url);
Logger.Error($"Failed to launch web browser for: {url}", ex);
}
}