O'Reilly logo

C# Primer Plus by Klaus Michelsen

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

Exception Handling: A Brief Overview

C#'s exception handling is object-oriented in that the exception generated by the execution engine in response to a special condition is an object that contains information about the corresponding abnormal condition. Any such exception object is either of class System.Exception or a subclass thereof. Typical predefined subclasses, found in the .NET Framework class library, are System.DivideByZeroException, System.InvalidOutOfRangeException, and System.NullReferenceException.

When an exceptional condition is encountered in a function, an exception object is created and thrown in that function. The function can catch (handle) the exception object itself or pass it on.

To implement code that monitors and handles ...

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