Skip to content

Commit

Permalink
Merge branch 'url-launch-fail' into upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
aspriddell committed Nov 11, 2024
2 parents 250a5b9 + eb545bf commit 153453c
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion DragonFruit.OnionFruit/App.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
using LucideAvalonia.Enum;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using Nito.AsyncEx;
using ReactiveUI;

Expand Down Expand Up @@ -254,7 +255,15 @@ public static bool Launch(string url)
UseShellExecute = true
};

return Process.Start(psi) != null;
try
{
return Process.Start(psi) != null;
}
catch (Exception e)
{
Instance.Services.GetRequiredService<ILogger<App>>().LogWarning(e, "Failed to launch URL due to an error: {err}", e.Message);
return false;
}
}

public static IconSource GetIcon(LucideIconNames icon, IImmutableSolidColorBrush brush = null, double thickness = 1.5)
Expand Down

0 comments on commit 153453c

Please sign in to comment.