Revert "Specify exception types in catch blocks for better error handling"

This reverts commit b3ee2cf020.
This commit is contained in:
ema
2026-01-19 23:28:17 +08:00
parent b3ee2cf020
commit 277754770a

View File

@@ -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
}