Ignore Exception in C#

后端 未结 9 736
梦毁少年i
梦毁少年i 2020-11-29 11:15

Is there a better way to ignore an exception in C# than putting it up in a try catch block and doing nothing in catch? I find this syntax to be cumbersome. For a codeblock,

9条回答
  •  攒了一身酷
    2020-11-29 11:28

    No. When exceptios occur, they travel back up the call stack either until they are handled by a catch block or the entire process terminates.

提交回复
热议问题