Commonly Used Exceptions Defined Within the System Namespace : Exception « Language Basics « C# / CSharp Tutorial






ExceptionMeaning
ArrayTypeMismatchExceptionType is incompatible with the type of the array.
DivideByZeroExceptionDivision by zero attempted.
IndexOutOfRangeExceptionArray index is out of bounds.
InvalidCastExceptionA runtime cast is invalid.
OutOfMemoryExceptionInsufficient free memory exists.
OverflowExceptionAn arithmetic overflow occurred.
NullReferenceExceptionAn attempt was made to operate on a null reference—that is, a reference that does not refer to an object.
StackOverflowExceptionThe stack was Overflow.


As a general rule, exceptions defined by you should be derived from ApplicationException since this is the

hierarchy reserved for application- related exceptions.









1.17.Exception
1.17.1.The Exception Hierarchy
1.17.2.The System.Exception Class
1.17.3.A Closer Look at Exception
1.17.4.Using Exception members
1.17.5.Exception propagation with methods
1.17.6.An unhandled exception
1.17.7.Commonly Used Exceptions Defined Within the System Namespace
1.17.8.Handling a possible exception.