list of exceptions [closed]

…衆ロ難τιáo~ 提交于 2019-12-03 11:10:57

问题


I am looking for a list of possible exceptions in c#, c++, vb.net, j# and jscript. The problem is that some sites show me a list of 20 exceptions whereas some other site shows me a list of 39 exceptions. Can anyone please give me a proper information on this?


回答1:


If you're looking for a list of exceptions that the .Net framework can throw, this article has a bunch of them. I don't know where you're pulling those specific numbers from and I don't know what you hope to accomplish by knowing all of the exceptions (including ones you'll likely never see).




回答2:


There are loads of exceptions declared by the .NET framework - and other code (including your own) can create more. There are certainly more than 39.... look at the documentation for System.Exception and you'll see near the bottom a list of all the direct known subclasses just in the .NET framework.

Basically, it's not useful to know "all the exceptions" - what's important is which exceptions can be thrown by code you are executing, and in particular which exceptions you should really try to handle (rather than those which should either kill the process or just make the request fail in a server environment).



来源:https://stackoverflow.com/questions/11376829/list-of-exceptions

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!