Skip to Content
Essential C# 3.0: For .NET Framework 3.5
book

Essential C# 3.0: For .NET Framework 3.5

by Mark Michaelis
August 2008
Intermediate to advanced content levelIntermediate to advanced
880 pages
18h 35m
English
Addison-Wesley Professional
Content preview from Essential C# 3.0: For .NET Framework 3.5

10. Exception Handling

CHAPTER 4 DISCUSSED using the try/catch/finally blocks for standard exception handling. In that chapter, the catch block always caught exceptions of type System.Exception. This chapter defines some additional details of exception handling—specifically, details surrounding additional exception types, defining custom exceptions, and multiple catch blocks for handling each type. This chapter also details exceptions because of their reliance on inheritance.

image

Multiple Exception Types

Listing 10.1 throws a System.ApplicationException, not the System.Exception type demonstrated in Chapter 4. C# allows code to throw any type that ...

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# 4.0 Unleashed

C# 4.0 Unleashed

Bart De Smet

Publisher Resources

ISBN: 9780321580559Purchase book