SonarAnalyzer.CSharp - General exceptions should never be thrown (Rule ID: S112) should check that the exception is actually thrown

85 views
Skip to first unread message

oha...@gmail.com

unread,
Jul 26, 2017, 10:08:26 AM7/26/17
to SonarLint
It should only trigger for things like: 
throw new Exception()

However, as of now it only seems to check for initialization. For example, this will also trigger the rule:
new Exception().ToString()

michal....@sonarsource.com

unread,
Jul 27, 2017, 7:21:55 AM7/27/17
to SonarLint, oha...@gmail.com
Thanks for reporting. I've created a ticket to tweak the rule:

https://github.com/SonarSource/sonar-csharp/issues/608

Regards,
Reply all
Reply to author
Forward
0 new messages