Documentation for Exceptions

G

Guest

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
 
M

Michael Nemtsev

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/d...rfsystemcollectionsarraylistclassaddtopic.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 Nietzsch
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top