catch block

Will both exceptions fire if the exception raised is a COMException, or will just the COMException fire and ignore the general Exception?

try
{
...
...
}
catch(COMException eeee)
                  {
                        genFuncs.SendMessage("tom@thebuyersfund.com","Problem in BFFaxCOM method LoopThroughGiftLetterBookmarks","EntryID:  " + this.FAXCOM_ENTRYID + "\n\n\nERROR MESSAGE FOLLOWS:  " + eeee.ToString());
                        genFuncs.SendMessage("jasons@thebuyersfund.com","Problem in BFFaxCOM method LoopThroughGiftLetterBookmarks","EntryID:  " + this.FAXCOM_ENTRYID + "\n\n\nERROR MESSAGE FOLLOWS:  " + eeee.ToString());
                  }
                  catch(Exception eee)
                  {
                        genFuncs.SendMessage("tom@thebuyersfund.com","Problem in BFFaxCOM method LoopThroughGiftLetterBookmarks","EntryID:  " + this.FAXCOM_ENTRYID + "\n\n\nERROR MESSAGE FOLLOWS:  " + eee.ToString());
                        genFuncs.SendMessage("jasons@thebuyersfund.com","Problem in BFFaxCOM method LoopThroughGiftLetterBookmarks","EntryID:  " + this.FAXCOM_ENTRYID + "\n\n\nERROR MESSAGE FOLLOWS:  " + eee.ToString());
                  }
LVL 5
Tom KnowltonWeb developerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

udo_borkowskiCommented:
Only the "most concrete" exception will be handle. So in your case the catch (COMExeception...) block when a COMException (or any "subclass" of COMException) is thrown. Any other Exception will be handled by the catch(Exception...) block.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
sachiekCommented:
Surely only COMException.


Sachi
0
Tom KnowltonWeb developerAuthor Commented:
??? only COMException will fire?
0
sachiekCommented:
YES Only COM Exception will be invoked.

Sachi
0
udo_borkowskiCommented:
>  ??? only COMException will fire?

Yes. If you have doubts, just give a try and raise a COMException in your try block and see what happens.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C#

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.