Skip to Main Content
C# Cookbook, 2nd Edition
book

C# Cookbook, 2nd Edition

by Jay Hilyard, Stephen Teilhet
January 2006
Intermediate to advanced content levelIntermediate to advanced
1184 pages
43h 23m
English
O'Reilly Media, Inc.
Content preview from C# Cookbook, 2nd Edition
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
364
Chapter 7
CHAPTER 7
Exception Handling
7.0 Introduction
This chapter contains recipes covering the exception-handling mechanism, includ-
ing the
try, catch, and finally blocks. Along with these recipes are others covering
the mechanisms used to throw exceptions manually from within your code. The final
types of recipes include those dealing with the
Exception classes and their uses, as
well as subclassing them to create new types of exceptions.
Often the design and implementation of exception handling is performed later in the
development cycle. But with the power and complexities of C# exception handling,
you need to plan and even implement your exception-handling scheme much earlier.
Doing so will increase the reliability and robustness of your code while minimizing the
impact of adding exception handling after most or all of the application is coded.
Exception handling in C# is very flexible. It allows you to choose a fine- or coarse-
grained approach to error handling and any level between. This means that you can
add exception handling around any individual line of code (the fine-grained
approach) or around a method that calls many other methods (the coarse-grained
approach), or you can use a mix of the two, with mainly a coarse-grained approach
and a more fine-grained approach
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

C# Cookbook

C# Cookbook

Joe Mayo
C# Cookbook

C# Cookbook

Stephen Teilhet, Jay Hilyard
Head First C#, 4th Edition

Head First C#, 4th Edition

Andrew Stellman, Jennifer Greene

Publisher Resources

ISBN: 0596100639Supplemental ContentCatalog PageErrata