Click here to Skip to main content
15,072,209 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I was wondering if anyone has a master list (all) of exceptions (or a link) for C#?
Posted

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.
   
v2
Comments
Mannava Siva Aditya 22-Apr-13 7:14am
   
Thanks for your reply!! I just tried to search in google all the list of exceptions exist in system.exception class. So IO,NullReference, and oother predefined exceptions are there so just want the complete list where i could not found!
   
Of course, my 5. It simply makes no sense. I tried to explain why, in my answer, but I don't think my explanation is complete. The complete explanation should require some explanation on how exception works, which OP fails to understand.
—SA
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.
   
Comments
Mannava Siva Aditya 22-Apr-13 7:16am
   
I agree with originalgriff but I am looking something like wanted to show all the exceptions which are predefined in .net.
   
My 5. I thought about something like that and would answered... if I thought it made any sense. The question makes no sense; please see my answer and my comments to other answers.
—SA
CPallini 29-Apr-13 3:27am
   
Thank you Sergey.
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
   
Comments
CPallini 29-Apr-13 3:28am
   
That makes sense :-) my 5.
   
Thank you, Carlo.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900