Jump to content

Catch Errors

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
5 replies to this topic

#1
Chan

Chan

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 204 posts
Is there a list of catch values that get thrown?

#2
hoser2001

hoser2001

    Programmer

  • Members
  • PipPipPipPip
  • 173 posts
i think what you want to know is...

say you have a pile of code thats giving you hell. and you want to find out where its going bad, throw a try catch around it here is what its gonna look like:

try
{
the code thats messed up.....
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}

#3
Guest_NeedHelp_*

Guest_NeedHelp_*
  • Guests
Are you looking for a list on the web or are you looking for howto do it like hoser2001 stated above?

#4
Chan

Chan

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 204 posts
I'd like a list of errors. I think I am catching them right. My code looks similar to yours hoser2001.

#5
hoser2001

hoser2001

    Programmer

  • Members
  • PipPipPipPip
  • 173 posts
I think what you want is is...

instead of:

ex.Message

you want:

ex.Stacktrace

This will give you a more detailed explanation of the errors if you will....

#6
brackett

brackett

    Programmer

  • Members
  • PipPipPipPip
  • 192 posts
Hmmm...I suppose you want a general list of Exceptions? MSDN should have a list somewhere, though I don't know how well organized it is. Of course, if you're using libraries or such, they've probably defined their own exceptions as well.

Or, if you're asking for checked exceptions (what a particular function can throw), you're out of luck. .NET doesn't do checked exceptions, though Java does.

BTW, I normally just do ex.ToString() which will give both the message and the stack trace.

Edit: Exception Helper will parse the XML doc tags, and automatically insert catch blocks for you...it's VB2005 only, though.