Exceptions should not be made internal and should be made public. Exceptions are designed to be reused across the codebase or in multiple codebases. By making an exception internal, it then cannot be reused across the different codebases.
Non-Compliant Code Examples
internalclassMyCustomException:Exception{}
Compliant Code Examples
publicclassMyCustomException:Exception{}
Seamless integrations. Try Datadog Code Analysis
Datadog Code Analysis
Try this rule and analyze your code with Datadog Code Analysis
How to use this rule
1
2
rulesets:- csharp-best-practices # Rules to enforce C# best practices.
Create a static-analysis.datadog.yml with the content above at the root of your repository
Use our free IDE Plugins or add Code Analysis scans to your CI pipelines