
org.sonar.plugins.csharp.S3984.html Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sonarlint-omnisharp-plugin Show documentation
Show all versions of sonarlint-omnisharp-plugin Show documentation
Code Analyzer based on Omnisharp
Why is this an issue?
Creating a new Exception
without actually throwing does
not achieve the intended purpose.
if (x < 0)
{
new ArgumentException("x must be nonnegative");
}
Ensure to throw the Exception
with a throw
statement.
if (x < 0)
{
throw new ArgumentException("x must be nonnegative");
}
Resources
Documentation
- Microsoft Learn -
Exception
Class
- Microsoft Learn - Exception-handling statements -
throw
, try-catch
, try-finally
, and try-catch-finally
© 2015 - 2025 Weber Informatics LLC | Privacy Policy