Description
Moved issue to .NET
Old issue: https://github.com/MicrosoftDocs/visualstudio-docs/issues/3228, opened by @motz-art
For full discussion of issue, see 3228.
Hi,
I would like to suggest an enhancement for case when Exception must have some properties initialized.
Documentation says that "Failure to provide the full set of constructors can make it difficult to correctly handle exceptions.". Is it fine to Suppress the warning in this case when next constructors provided: CustomException(RequiredData), CustomException(RequiredData, string), CustomException(RequiredData, string, Exception)?
So having CustomException(RequiredData, string, Exception) would still allow me to create custom exception and specify that it's caused by another exception.
If it's not fine to suppress, please explain why and what is the best practice?
Thank you
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: 9abd4d8f-7c08-c6b6-f05c-f40c359fc550
- Version Independent ID: 19e424e2-3191-b900-de2d-40ff3eb41ca4
- Content: CA1032: Implement standard exception constructors (code analysis) - .NET
- Content Source: docs/fundamentals/code-analysis/quality-rules/ca1032.md
- Product: dotnet-fundamentals
- GitHub Login: @gewarren
- Microsoft Alias: gewarren