Is there any valid reason to ever ignore a caught exception

后端 未结 24 1950
南笙
南笙 2020-11-27 15:43

Wow, I just got back a huge project in C# from outsourced developers and while going through my code review my analysis tool revealed bunches of what it considered bad stuff

24条回答
  •  感动是毒
    2020-11-27 16:07

    I sometimes use a WebControl that is not compulsory for a page to display. If it fails, I don't want to prevent the page from displaying. An example of a non-critical WebControl would be one that displays an advertisement.

    However, I do log the error. I just don't rethrow it.

提交回复
热议问题