Finding out what exceptions a method might throw in C#

后端 未结 4 1378
无人及你
无人及你 2020-12-08 00:40

Is there any way to find out what exceptions might be thrown by any method in .NET code? Ideally I want to see what might be thrown and choose which ones I want to handle. I

4条回答
  •  天涯浪人
    2020-12-08 01:08

    As long as you're using BCL classes, they are all completely documented and Intellisense therefore displays any exception a method can throw. Other than that (and reading the docs), there is no way, I think.

提交回复
热议问题