Who Is Throwing What?
Given that a method in the .NET Framework could throw any number of exceptions (under various
circumstances), a logical question would be “How do I know which exceptions may be thrown by a
given base class library method?” The ultimate answer is simple: consult the .NET Framework 3.5
SDK documentation. Each method in the help system documents the exceptions a given member
may throw. As a quick alternative, Visual Studio 2008 allows you to view the list of all exceptions
thrown by a base class library member (if any) simply by hovering your mouse cursor over the
member name in the code window (see Figure 7-6).
C H A P T E R 7
Do'stlaringiz bilan baham: |