用于检测吞噬异常的 FxCop 规则
是否有 FxCop 规则来查找吞没的异常?
我找到了这篇文章 http://mystuffisallhere.com/blog/post/2006/01/02/An-FxCop-rule-to-detect-swallowed-exceptions.aspx 但我找不到执行此操作的代码或 dll 。
谢谢 阿尔米尔
is there a FxCop rule to find swallowed exceptions?
I have found this article http://mystuffisallhere.com/blog/post/2006/01/02/An-FxCop-rule-to-detect-swallowed-exceptions.aspx but I can not find the code or dll which does the job.
thanks
almir
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
CA1031 [1] 应该“抓住”最严重的罪犯,即“包罗万象”的
宪兵 [2] 也有类似的规则 [3],如果您希望将其扩展到检测所有异常情况,可以使用完整的源代码。
[1] http://msdn.microsoft。 com/en-us/library/ms182137%28v=VS.100%29.aspx
[2] 披露:我是宪兵维护者
[3] https://github.com/spouliot/gendarme/wiki/Gendarme.Rules.Exceptions.DoNotSwallowErrorsCatchingNonSpecificExceptionsRule%282.10%29
CA1031 [1] should "catch" the worse offenders, i.e. the "catch-all"
Gendarme [2] has a similar rule [3] and full source code is available if you wish to extend it into detecting every cases where exceptions are swallowed.
[1] http://msdn.microsoft.com/en-us/library/ms182137%28v=VS.100%29.aspx
[2] disclosure: I'm Gendarme maintainer
[3] https://github.com/spouliot/gendarme/wiki/Gendarme.Rules.Exceptions.DoNotSwallowErrorsCatchingNonSpecificExceptionsRule%282.10%29