|
There are two important classes in the hierarchy that are derived from System.Exception:
1) System.SystemException -> This class is for exceptions that are usually thrown by the .Net runtime, or which are 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, you might choose to throw ArgumentException or it is subclasses in ur code, if you detect that a method has been called with in-appropriate arguments. Subclasses of System.SystemException includes classes that represent both fatal and non-fatal errors.
2) System.ApplicationException-> This class is important, because it is the intended base for any class of exception defined by third parties. Hence, if you define any exceptions covering error conditions unique to your application, you should derive these directly or indirectly from System.ApplicationException
|