From 277754770a428cb203d837e49addc33347751c18 Mon Sep 17 00:00:00 2001 From: ema Date: Mon, 19 Jan 2026 23:28:17 +0800 Subject: [PATCH] Revert "Specify exception types in catch blocks for better error handling" This reverts commit b3ee2cf020d7fa07e4fd7bbc4cea2982e3fe675a. --- QuickLook/App.xaml.cs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/QuickLook/App.xaml.cs b/QuickLook/App.xaml.cs index 42cf48b..75570cd 100644 --- a/QuickLook/App.xaml.cs +++ b/QuickLook/App.xaml.cs @@ -25,7 +25,6 @@ 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; @@ -135,8 +134,7 @@ public partial class App : Application if (Directory.Exists(path) || File.Exists(path)) PipeServerManager.SendMessage(PipeMessages.Toggle, path); } - catch (Exception ex) when (ex is ArgumentException || ex is SecurityException || - ex is NotSupportedException || ex is PathTooLongException) + catch { // Invalid path, ignore } @@ -314,8 +312,7 @@ public partial class App : Application return false; } } - catch (Exception ex) when (ex is ArgumentException || ex is SecurityException || - ex is NotSupportedException || ex is PathTooLongException) + catch { // Invalid path, continue to show duplicate message }