"Frank Oquendo" <fr****@acadxpin.com> wrote in message
news:uM**************@TK2MSFTNGP09.phx.gbl...
clintonG wrote: Could someone provide me with a URL documenting the
specific order of exceptions?
From the most specific of your catch blocks to the most general. So an
exception of a specific type would be caught by a matching catch block
rather than a catch set up for something generic like Exception.
--
There are 10 kinds of people. Those who understand binary and those who
don't.
http://code.acadx.com
(Pull the pin to reply)
Thanks for replying Frank. Your correct about specific-to-general
order of operations and I mentioned 'specific order' but was vague
when indicating I am asking how to actually determine specificity.
Using one of Roy's referrals to the C# Language Reference at MSDN
"How exceptions are handled" [1], I was able to use the sidebar menu
to navigate to "Common Exception Classes" [2]. Are we to assume those
common exception classes are listed top-down in order of specificity?
Indications do not support that assumption leaving the determination of
specificity to be determined by other means.
After posting the question -- which is usually the ways it goes -- I found
what seemed to be an answer in the "System Hierarchy" [3]. It seems we
should use the 'specific' derived classes such as DivideByZeroException
rather than the more 'general' ArithmeticException base class which is clear
enough but...
How for example is the developer to determine the specificity of using
DivideByZeroException as opposed to using FormatException?
I imagine one should attempt to catch a FormatException as the implied
circumstances suggest the developer would want to determine if the
correct data type had been submitted before attempting to use that data
in any operation. Thus FormatException would be more specific than
DivideByZeroException. Is this thinking correct?
What page of the documentation is experience listed on? :-)
[1]
http://msdn.microsoft.com/library/de...pspec_16_3.asp
[2]
http://msdn.microsoft.com/library/de...pspec_16_4.asp
[3]
http://msdn.microsoft.com/library/de...mhierarchy.asp
<%= Clinton Gallagher