diff --git a/PKHeX.WinForms/MainWindow/Main.cs b/PKHeX.WinForms/MainWindow/Main.cs index a9e04fee0..59dc84018 100644 --- a/PKHeX.WinForms/MainWindow/Main.cs +++ b/PKHeX.WinForms/MainWindow/Main.cs @@ -524,9 +524,7 @@ private void OpenFromPath(string path) OpenFile(input, path, ext); #else try { OpenFile(input, path, ext); } -#pragma warning disable CA1031 // Do not catch general exception types catch (Exception e) { WinFormsUtil.Error(MsgFileLoadFail + "\nPath: " + path, e); } -#pragma warning restore CA1031 // Do not catch general exception types #endif } diff --git a/PKHeX.WinForms/PKHeX.WinForms.csproj b/PKHeX.WinForms/PKHeX.WinForms.csproj index f1a51fccd..1f63bf966 100644 --- a/PKHeX.WinForms/PKHeX.WinForms.csproj +++ b/PKHeX.WinForms/PKHeX.WinForms.csproj @@ -13,7 +13,7 @@ PKHeX.WinForms.Program PKHeX 22.01.01 - 9 + 10 enable diff --git a/PKHeX.WinForms/Program.cs b/PKHeX.WinForms/Program.cs index 20f05681f..31c601140 100644 --- a/PKHeX.WinForms/Program.cs +++ b/PKHeX.WinForms/Program.cs @@ -51,9 +51,7 @@ private static void UIThreadException(object sender, ThreadExceptionEventArgs t) { result = ErrorWindow.ShowErrorDialog("An unhandled exception has occurred.\nYou can continue running PKHeX, but please report this error.", t.Exception, true); } -#pragma warning disable CA1031 // Do not catch general exception types catch (Exception reportingException) -#pragma warning restore CA1031 // Do not catch general exception types { HandleReportingException(t.Exception, reportingException); } @@ -85,9 +83,7 @@ private static void CurrentDomain_UnhandledException(object sender, UnhandledExc Error("A fatal non-UI error has occurred in PKHeX, and the details could not be displayed. Please report this to the author."); } } -#pragma warning disable CA1031 // Do not catch general exception types catch (Exception reportingException) -#pragma warning restore CA1031 // Do not catch general exception types { HandleReportingException(ex, reportingException); } @@ -124,9 +120,7 @@ private static bool EmergencyErrorLog(Exception? originalException, Exception er var message = (originalException?.ToString() ?? "null first exception") + Environment.NewLine + errorHandlingException; File.WriteAllText($"PKHeX_Error_Report {DateTime.Now:yyyyMMddHHmmss}.txt", message); } -#pragma warning disable CA1031 // Do not catch general exception types catch (Exception) -#pragma warning restore CA1031 // Do not catch general exception types { // We've failed to save the error details twice now. There's nothing else we can do. return false;