Well, ur supposed to catch more specific exceptions first..for example, if
you do:
catch (Exception ex)
{
}
catch(SqlException ex)
{
}
the 2nd catch can NEVER execute, since the first one will always catch
whatever the 2nd one could.
But as I say, there's very little hierarchy to the exiting exceptions. Most
inherit directly from Exception, so you don't need to worry about it, just
catch whatever exception you need BEFORE catching System.Exception, and
you'll be alright 95% of the time.
Karl
--
http://www.openmymind.net/
"clintonG" <cs*********@REMOVETHISTEXTmetromilwaukee.com> wrote in message
news:Oe**************@TK2MSFTNGP14.phx.gbl...
Well, yes to Peter in the sense I was wondering if somebody had drafted a
FAQ for exception management that I haven't found yet and AFIK Karl, there
is a specific order we are supposed to use to catch exceptions. Meanwhile,
I'm reading the Exception Management Architecture Guide [1] and appreciate
the comments...
<%= Clinton Gallagher
[1]
http://msdn.microsoft.com/library/de...ceptdotnet.asp
"Karl Seguin [MVP]" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME
net> wrote in message news:uO*************@TK2MSFTNGP09.phx.gbl... I'm not clear either.
There's no set order to catch exceptions. You should simply catch what
you can handle. The hierarchy isn't very deep, it's hard to imagine it's
causing any problems. You can use a tool like reflector to see what
inherits from what. so if you want to catch ApplicationException but want
to see if there's something more specific, you could see, using
Reflector, what inherits from it.
Again, the hierarchy isn't very deep/complex however and I doubt you'll
ever really be handling that many exceptions.
Karl
--
http://www.openmymind.net/
"Peter Rilling" <pe***@nospam.rilling.net> wrote in message
news:ut**************@TK2MSFTNGP12.phx.gbl... Not sure I understand your request. Are you simply looking for a
document that lists all the exceptions available to use?
"clintonG" <cs*********@REMOVETHISTEXTmetromilwaukee.com> wrote in
message news:uV*************@TK2MSFTNGP12.phx.gbl...
I was wondering if anybody has put together a FAQ documenting the
hierarchy of various exceptions? Trying to learn and remember which to
include and which order to process exceptions is not entertaining :-)
<%= Clinton Gallagher