By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,816 Members | 2,151 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,816 IT Pros & Developers. It's quick & easy.

Documentation for Exceptions

P: n/a
Hi everyone,

I tried to find a satisfactory answer for this question before I asked it,
but maybe someone can enlighten me:

How come the MSDN documentation for a particular function that throws an
exception doesn't have that exception listed among its properties, methods,
and events? (I'm sure you know where I'm going with this...)

In Java documentation for their ArrayList for example, you can look at the
..Add method and see clearly that it throws an IndexOutOfBoundsException if
the index is out of range. Perhaps I'm not using the MSDN documentation
correctly, but I have a difficult time finding that kind of information for
VB.NET classes.

I'm attempting to follow the recommendation of not catching System.Exception
every time I do a try...catch, but when I have a couple of method calls
within the block that raise exceptions I don't see easily in the docs, it
makes it a real (and seemingly unnecessary) challenge to do so.

I'm hoping that some of you folks who have been in the .NET world longer
than I would be able to help me out with this problem....

How can you begin to decide whether you SHOULD handle an exception in a code
block when you can't easily find out what exceptions CAN be thrown by that
code?

Thanks in advance for your comments and assistance!
Mike
Mar 17 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hello Mike,

Where are you looking at? There are a exception setting for each class member
for example ArrayList.Add http://msdn.microsoft.com/library/de...ssaddtopic.asp

ME> Hi everyone,
ME>
ME> I tried to find a satisfactory answer for this question before I
ME> asked it, but maybe someone can enlighten me:
ME>
ME> How come the MSDN documentation for a particular function that
ME> throws an exception doesn't have that exception listed among its
ME> properties, methods, and events? (I'm sure you know where I'm going
ME> with this...)
ME>
ME> In Java documentation for their ArrayList for example, you can look
ME> at the .Add method and see clearly that it throws an
ME> IndexOutOfBoundsException if the index is out of range. Perhaps I'm
ME> not using the MSDN documentation correctly, but I have a difficult
ME> time finding that kind of information for VB.NET classes.
ME>
ME> I'm attempting to follow the recommendation of not catching
ME> System.Exception every time I do a try...catch, but when I have a
ME> couple of method calls within the block that raise exceptions I
ME> don't see easily in the docs, it makes it a real (and seemingly
ME> unnecessary) challenge to do so.
ME>
ME> I'm hoping that some of you folks who have been in the .NET world
ME> longer than I would be able to help me out with this problem....
ME>
ME> How can you begin to decide whether you SHOULD handle an exception
ME> in a code block when you can't easily find out what exceptions CAN
ME> be thrown by that code?
ME>
ME> Thanks in advance for your comments and assistance! Mike
ME>
---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
Mar 17 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.