■
Note
To make the code examples used in this book as clean as possible, I will not catch every possible excep-
tion that may be thrown by a given method in the base class libraries. In your production-level projects, you
should, of course, make liberal use of the techniques presented in this chapter.
The Role of .NET Exception Handling
Prior to .NET, error handling under the Windows operating system was a confused mishmash of
techniques. Many programmers rolled their own error-handling logic within the context of a given
application. For example, a development team may define a set of numerical constants that repre-
sent known error conditions, and make use of them as method return values. By way of an example,
ponder the following partial C code:
Do'stlaringiz bilan baham: |