Is there any valid reason to ever ignore a caught exception

后端 未结 24 1892
南笙
南笙 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:23

    I think that if you have an empty catch block you need to document why it is empty so that the next developer will know. For example on server.transfer a web exception is sometimes thrown. I catch that and comment that we can ignore it because of the transfer call.

提交回复
热议问题