1.2. Structured Exception Handling

There are two different ways in which computer programs respond to, or handle, exceptions. Many procedural languages use unstructured exception handling, in which execution jumps to a specified line in your program whenever an exception it thrown.

However, the preferred method for object-oriented languages is to use structured exception handling. Structured exception handling uses language constructs to isolate blocks of code. It allows you to implement one or more exception handlers that execute if and only if an exception is thrown, and a finally handler that always executes, regardless of whether an exception is thrown. Exception handlers can be configured to catch specific exceptions. Exception handlers ...

Get Robust ASP.NET Exception Handling now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.