C#的例外列表!! [英] List of Exception for C#!!

查看:106
本文介绍了C#的例外列表!!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有人有C#的例外(或链接)主列表(全部)?

解决方案

No。

没有所有异常列表 - 异常是一个派生自IOException,NullReferenceException和用户异常的类。这些类中的每一个都可以出于任何原因抛出任何消息。



AFAIK甚至没有可以由.NET框架抛出的异常列表,更不用说所有例外。


我们的''原创''已经正确回答了你的问题。基于他的最后一句,我用Google搜索了一下,找到了这个页面:.NET异常 - 源代码 [ ^ ],我想你可能会对它感兴趣。


我认为制作例外列表的愿望可能只是对异常的完全错误理解的一个标志。由于例外的性质,这种知识毫无意义。如果你需要处理一些特殊的异常,你会知道哪一个;在这种情况下,您将能够使用特定于特定异常的异常信息。否则你将处理 System.Exception ,其中包含所有例外情况。



-SA

I was wondering if anyone has a master list (all) of exceptions (or a link) for C#?

解决方案

No.
There is no "List of all exceptions" - Exception is a class which is derived from, into IOException, NullReferenceException and user exceptions for example. Each of these classes can be thrown with any message for any reason.

AFAIK there isn''t even a list of exceptions that can be thrown by the .NET framework, let alone all exceptions.


Our ''Original'' already answered correctly to your question. Based on his last sentence, I Googled a bit and found this page: ".NET Exceptions – source code"[^] , I suppose it might interest you.


I think that the desire to make a list of exceptions can be a sign of only one thing totally wrong understanding of exceptions. With the nature of exceptions, such knowledge makes no sense at all. If you need to handle some particular exception, you will know which one; in this case, you will be able to use exception information specific to a particular exception. Otherwise you would handle System.Exception which covers all the exceptions.

—SA


这篇关于C#的例外列表!!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆