Exceptions - 500 pts

Posted on 2006-04-10
Medium Priority
Last Modified: 2010-04-23
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
Question by:rocky050371
LVL 14

Expert Comment

ID: 16423786
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.

Accepted Solution

manojkumarps earned 1500 total points
ID: 16423942
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.


Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question