How do I use the information about exceptions a method throws in .NET in my code?
Posted
by dotnetdev
on Stack Overflow
See other posts from Stack Overflow
or by dotnetdev
Published on 2010-03-22T22:57:02Z
Indexed on
2010/03/22
23:01 UTC
Read the original article
Hit count: 309
For many methods in .NET, the exceptions they can potentially throw can be as many as 7-8 (one or two methods in XmlDocument, Load() being one I think, can throw this many exceptions).
Does this mean I have to write 8 catch blocks to catch all of these exceptions (it is best practise to catch an exception with a specific exception block and not just a general catch block of type Exception).
How do I use this information?
Thanks
© Stack Overflow or respective owner