However, certain errors can be caught only at run time, and therefore a consistent means of dealing with errors must be used across all the languages that comply with the Common Language Specification (CLS). To that extent, this chapter focuses on the error-handling system implemented by the CLR—exception handling.-
In this chapter, you'll first learn the general mechanics and basic syntax of exception handling. Once you have this baseline knowledge, you'll see how exception handling compares with the more prevalent methods of error handling today and you'll discover the advantages that exception handling has over these other techniques. We'll then dive into some of the more specific .NET exception-handling issues, such as using the Exception class and deriving your own exception classes. Finally, the last part of this chapter will deal with the issue of properly designing your system to use exception handling.