O'Reilly logo

ASP.NET Developer's JumpStart by Ken Getz, Paul D. Sheriff

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

Working with Specific Exceptions

The .NET Framework provides a significant number of specific exception classes, all inheriting from the base Exception class. In the .NET Framework documentation, you'll find tables listing all the possible exceptions that might occur when you call any method. For example, Table 12.2, taken from the .NET Framework documentation, makes it easy to determine what might go wrong when calling the File.Open method.

Table 12.2. Exception Types That Can Be Generated When You're Attempting to Open a File
Exception Type Condition
SecurityException The caller to this routine does not have sufficient permissions.
ArgumentException The path is empty, contains invalid characters, or contains only whitespace.
FileNotFoundException ...

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