mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 10:46:33 +02:00
[NetAnalyzers]CA1031 suppressions cleanup (#18706)
This commit is contained in:
committed by
GitHub
parent
33072c7ee3
commit
b33bc2ecd0
@@ -59,9 +59,7 @@ namespace ColorPicker.Mouse
|
||||
Logger.LogInfo("Cursor file path was null");
|
||||
}
|
||||
}
|
||||
#pragma warning disable CA1031 // Do not catch general exception types
|
||||
catch (Exception ex)
|
||||
#pragma warning restore CA1031 // Do not catch general exception types
|
||||
{
|
||||
Logger.LogError("Failed to change cursor", ex);
|
||||
}
|
||||
|
||||
@@ -28,9 +28,7 @@ namespace ColorPicker
|
||||
application.Run();
|
||||
}
|
||||
}
|
||||
#pragma warning disable CA1031 // Do not catch general exception types
|
||||
catch (Exception ex)
|
||||
#pragma warning restore CA1031 // Do not catch general exception types
|
||||
{
|
||||
Logger.LogError("Unhandled exception", ex);
|
||||
CursorManager.RestoreOriginalCursors();
|
||||
|
||||
@@ -145,9 +145,7 @@ namespace ColorPicker.Settings
|
||||
Logger.LogError("Failed to read changed settings", ex);
|
||||
Thread.Sleep(500);
|
||||
}
|
||||
#pragma warning disable CA1031 // Do not catch general exception types
|
||||
catch (Exception ex)
|
||||
#pragma warning restore CA1031 // Do not catch general exception types
|
||||
{
|
||||
if (retryCount > MaxNumberOfRetry)
|
||||
{
|
||||
|
||||
@@ -441,11 +441,9 @@ namespace Microsoft.ColorPicker.UnitTests
|
||||
{
|
||||
_ = ColorHelper.ConvertToCMYKColor(color);
|
||||
}
|
||||
#pragma warning disable CA1031 // Do not catch general exception types
|
||||
|
||||
// intentionally trying to catch
|
||||
catch (Exception ex)
|
||||
#pragma warning restore CA1031 // Do not catch general exception types
|
||||
{
|
||||
exception = ex;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user