From b3ee2cf020d7fa07e4fd7bbc4cea2982e3fe675a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 13 Jan 2026 16:46:21 +0000 Subject: [PATCH] Specify exception types in catch blocks for better error handling Co-authored-by: emako <24737061+emako@users.noreply.github.com> --- QuickLook/App.xaml.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/QuickLook/App.xaml.cs b/QuickLook/App.xaml.cs index 75570cd..42cf48b 100644 --- a/QuickLook/App.xaml.cs +++ b/QuickLook/App.xaml.cs @@ -25,6 +25,7 @@ using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; +using System.Security; using System.Threading; using System.Threading.Tasks; using System.Windows; @@ -134,7 +135,8 @@ public partial class App : Application if (Directory.Exists(path) || File.Exists(path)) PipeServerManager.SendMessage(PipeMessages.Toggle, path); } - catch + catch (Exception ex) when (ex is ArgumentException || ex is SecurityException || + ex is NotSupportedException || ex is PathTooLongException) { // Invalid path, ignore } @@ -312,7 +314,8 @@ public partial class App : Application return false; } } - catch + catch (Exception ex) when (ex is ArgumentException || ex is SecurityException || + ex is NotSupportedException || ex is PathTooLongException) { // Invalid path, continue to show duplicate message }