Exceptions - 500 pts

If I create my own exception is it better to inherit from applicationexception or simply exception.

Also if throwing a new exception is it best to throw an applicationexception or a base exception
rocky050371Asked:
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.

jjardineCommented:
Here is an article talking about the creating of custom exceptions.  There recommendation is to inherit from ApplicationException.   Personally when I create my own exceptions I inherit from ApplicationException as well.   Here is the link:  http://msdn.microsoft.com/msdnmag/issues/02/11/NETExceptions/

As far as when throwing an exception..   I usually use    Throw new Exception("My Message") .  I am unsure of the difference of throwing base exception vs. applicationException.     Hope that helps.
jjardine
0
manojkumarpsCommented:
Hello rocky050371,
     I liked your question as you want to handle the exceptions with your own class.

You can create a class of your own which will inherit the application exception.
Inside the class create the properties and function to catch and henadle the exceptions.

Create a exception manager class of you own for publishing the exceptions if you want with the user id or form id or form name or any other global variables present in your application.

You can even create a form where the email is sent to the support team as soon as an exception is generated using the exception manager.

If you want the code reply with requirements.

Regards,
Manoj
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
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
Visual Basic.NET

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.