Method Exception information

  • Thread starter Thread starter PGP
  • Start date Start date
P

PGP

Where will i look to find potential exceptions thrown by a method? I am
looking at Object Browser and couldnt find any, MSDN doesnt seem to provide
a consistent format for this either. Any advice would be appreciated.
 
Hello PGP" priyesh_do_not_reply,

Which method, for example?
u cat use reflector either.
If u found nothing it can be that method throws nothing

---
WBR, Michael Nemtsev [C# MVP].
My blog: http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo

P> Where will i look to find potential exceptions thrown by a method? I
P> am looking at Object Browser and couldnt find any, MSDN doesnt seem
P> to provide a consistent format for this either. Any advice would be
P> appreciated.
P>
 
Hi,

Sorry, wrong key combination :)

As I said, there is no way to know that.

You could use reflector and try to see the method and see what exception the
method throw, but even so if the method use other methods these could also
throw exceptions (not catched by your method) that you will have to deal
with.
 
Which method, for example?
I was looking at XMLSerializer.Deserialize. I have a scenario where a class
loads internal data from a config xml and was wondering what exception to
catch if load fails.
 
As I said, there is no way to know that.
I guess it's safe to catch the base Exception then.
 
Hi,

Yes, you can always catch Exception ,

I have to confess I do most of the times :-)
 

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

Back
Top