C# try-catch-else

后端 未结 14 1471
暗喜
暗喜 2020-12-30 19:44

One thing that has bugged me with exception handling coming from Python to C# is that in C# there doesn\'t appear to be any way of specifying an else clause. For example, in

14条回答
  •  既然无缘
    2020-12-30 20:19

    Exceptions are used differently in .NET; they are for exceptional conditions only.

    In fact, you should not catch an exception unless you know what it means, and can actually do something about it.

提交回复
热议问题