hi to all,
what is systemException class & ApplicationExcetion class.
How can i develope custom excetion handler and how the above 2 classes are usefull and which is use full in which scenarios.
any considerations to develope custom excetion handlers.
example is preferable
Loading
Niradhip ChakrabortyPosted Sep 2, 2008, 5:18 PM
There r 2 important classes in the hierarchy that r derived from System.Exception:
1) System.SystemException -> This class is for exceptions that r usually thrown by the .net runtime, or which r considered to be of a generic nature and must be thrown by almost any application. For example, StackOverflowException will be thrown by the .net runtime if it detects the stack is full. On the other hand, u might choose to throw ArgumentException or it’s subclasses in ur code, if u detect that a method has been called with inappropriate arguments. Subclasses of System.SystemException includes classes that represent both fatal and non-fatal errors.
2) System.ApplicationException-> This class is important, becoz it is the intended base for any class of exception defined by third parties. Hence, if u define any exceptions covering error conditions unique to ur application, u should derive these directly or indirectly from System.ApplicationException
Refer the following articles:
SystemException Class:
1.http://www.msluder.dk/Resources/cli/refdocs/System/types/SystemException.html
2.http://www.csharpfriends.com/Articles/getArticle.aspx?articleID=128
Creating custom application exception C#:
1.http://nishantrana.wordpress.com/2008/01/11/creating-custom-application-exception-c/
Exception Class:
1.http://msdn.microsoft.com/en-us/library/system.exception(VS.71).aspx
2.http://en.csharp-online.net/Exception_classes