O'Reilly logo

CLR via C#, Fourth Edition by Jeffrey Richter

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

Chapter 20. Exceptions and State Management

In this chapter:

Defining “Exception”

Exception-Handling Mechanics

The System.Exception Class

FCL-Defined Exception Classes

Throwing an Exception

Defining Your Own Exception Class

Trading Reliability for Productivity

Guidelines and Best Practices

Unhandled Exceptions

Debugging Exceptions

Exception-Handling Performance Considerations

Constrained Execution Regions (CERs)

Code Contracts

This chapter is all about error handling. But it’s not just about that. There are several parts to error handling. First, we’ll define what an error actually is. Then, we’ll talk about how to discover when your code is experiencing an error and about how to recover from this error. At this point, state becomes an issue because errors ...

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