Mega Code Archive

 
Categories / C# Tutorial / Language Basics
 

Commonly Used Exceptions Defined Within the System Namespace

Exception Meaning 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.