O'Reilly logo

.NET Common Language Runtime Unleashed by Kevin Burton

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Exceptions Overview

At the base of all exception classes is System.Exception, which derives from System.Object.

Note

It is possible to throw a System.Object directly from System.Object, but doing so is not consistent with how exceptions are used in the CLR. In addition, the C# compiler doesn't allow it.

Most (if not all) of the exception classes derived from System.Exception do not add functionality, but they do provide a type so that errors can be filtered and handled in the correct context as discussed previously. Many classes are derived directly from System.Exception. A couple of classes that derive directly from System.Exception are IOException and WebException. IOException is thrown when an I/O error occurs (usually the result of an operation ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required