mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-04 10:16:24 +02:00
[NetAnalyzers]CA1031 suppressions cleanup (#18706)
This commit is contained in:
committed by
GitHub
parent
33072c7ee3
commit
b33bc2ecd0
@@ -75,9 +75,7 @@ namespace Microsoft.PowerToys.PreviewHandler.Gcode
|
||||
base.DoPreview(dataSource);
|
||||
PowerToysTelemetry.Log.WriteEvent(new GcodeFilePreviewed());
|
||||
}
|
||||
#pragma warning disable CA1031 // Do not catch general exception types
|
||||
catch (Exception ex)
|
||||
#pragma warning restore CA1031 // Do not catch general exception types
|
||||
{
|
||||
PreviewError(ex, dataSource);
|
||||
}
|
||||
|
||||
@@ -130,9 +130,7 @@ namespace Microsoft.PowerToys.PreviewHandler.Pdf
|
||||
});
|
||||
}
|
||||
}
|
||||
#pragma warning disable CA1031 // Password protected files throws an generic Exception
|
||||
catch (Exception ex)
|
||||
#pragma warning restore CA1031
|
||||
{
|
||||
if (ex.Message.Contains("Unable to update the password. The value provided as the current password is incorrect.", StringComparison.Ordinal))
|
||||
{
|
||||
@@ -156,9 +154,7 @@ namespace Microsoft.PowerToys.PreviewHandler.Pdf
|
||||
|
||||
PowerToysTelemetry.Log.WriteEvent(new PdfFilePreviewed());
|
||||
}
|
||||
#pragma warning disable CA1031 // Do not catch general exception types
|
||||
catch (Exception ex)
|
||||
#pragma warning restore CA1031 // Do not catch general exception types
|
||||
{
|
||||
PowerToysTelemetry.Log.WriteEvent(new PdfFilePreviewError { Message = ex.Message });
|
||||
|
||||
|
||||
@@ -59,9 +59,7 @@ namespace Common.Utilities
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning disable CA1031 // Do not catch general exception types
|
||||
catch (Exception)
|
||||
#pragma warning restore CA1031 // Do not catch general exception types
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user