Re-throw the exception if we cannot open the URL in the default browser

This commit is contained in:
Jack251970 2025-06-04 22:22:02 +08:00
parent 32ae3a1b67
commit 4bc34f64e8

View file

@ -68,10 +68,18 @@ namespace Flow.Launcher.Plugin.SharedCommands
// This error may be thrown if browser path is incorrect
catch (Win32Exception)
{
Process.Start(new ProcessStartInfo
try
{
FileName = url, UseShellExecute = true
});
Process.Start(new ProcessStartInfo
{
FileName = url,
UseShellExecute = true
});
}
catch
{
throw; // Re-throw the exception if we cannot open the URL in the default browser
}
}
}
@ -103,10 +111,18 @@ namespace Flow.Launcher.Plugin.SharedCommands
// This error may be thrown if browser path is incorrect
catch (Win32Exception)
{
Process.Start(new ProcessStartInfo
try
{
FileName = url, UseShellExecute = true
});
Process.Start(new ProcessStartInfo
{
FileName = url,
UseShellExecute = true
});
}
catch
{
throw; // Re-throw the exception if we cannot open the URL in the default browser
}
}
}
}