Click here to Skip to main content
15,880,967 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

I want to ask a question about error codes. I have a name space, and many classes inside of it. I want to catch all the exception and give error codes to them.
What kind of structure should I use to access this error structure from different classes?

The error structure will have more than one error codes.

Thank you very much

Lilly
Posted

I suppose the 'standard' Exception class[^] fits well with your requirements: it provides all you need and more.
 
Share this answer
 
Comments
Espen Harlinn 26-Jan-12 15:29pm    
Good point :)
CPallini 27-Jan-12 3:22am    
Thank you.
Wonde Tadesse 26-Jan-12 21:05pm    
5+
CPallini 27-Jan-12 3:22am    
Thank you.
This article gives a good description of how to create a custom exception: http://msdn.microsoft.com/en-us/library/ms229064.aspx[^]
You may get some good information on how to implement these custom exceptions from here[^].
 
Share this answer
 
Comments
Espen Harlinn 26-Jan-12 15:29pm    
Nice link :)
fjdiewornncalwe 26-Jan-12 16:19pm    
Thanks Espen
Wonde Tadesse 26-Jan-12 21:06pm    
5+

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