473,385 Members | 1,341 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Exception Hierarchy FAQ?

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
Jan 22 '06 #1
4 1376
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

Jan 22 '06 #2
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


Jan 22 '06 #3
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



Jan 22 '06 #4
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



Jan 22 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Gil | last post by:
In C++, I can rethrow the exception I just caught with the throw statement. Can I do something similar in Java? } catch (Exception ex) { throw; }
42
by: cody | last post by:
public DateTime Value { get { try { return new DateTime(int.Parse(tbYear.Text), int.Parse(tbMonth.Text), int.Parse(tbDay.Text)); } catch (FormatException)
13
by: Markus Elfring | last post by:
Do you know a class library that can convert the error/return codes that are listed in the standard header file "errno.h" into a well-known exception hierarchy? Did anybody derive it from...
11
by: Master of C++ | last post by:
Hi, I am writing a simulation package in C++, and so far I've written about 8000 lines of code and have about 30 classes. I haven't used C++ exceptions so far (for various reasons). The only two...
16
by: ChInKPoInt [No MCSD] | last post by:
I am using Visual Studio 2K3 writing a ASP.NET web application. Is there a way to force the C# compiler to catch possible exception? In Java, all exceptions thrown MUST BE caught, otherwise...
5
by: KJ | last post by:
This is kind of hard to explain but I have a The controls are created with CreateChildControls(). Now let say I click a button and an error occurs in the control. If I throw it up it goes back...
6
by: toton | last post by:
Hi, I am c++ standard exceptions like out_of_range, but want it to have some nonascii message. However what returns a char* and the class is not templated. Do I need to write my own exception...
16
by: josephgarry | last post by:
Is there anyway that I can get at the actual exception in a catch(...)?
10
by: John Nagle | last post by:
Here are three network-related exceptions. These were caught by "except" with no exception type, because none of the more specific exceptions matched. This is what a traceback produced: 1....
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.