Exceptions - 500 pts

Posted on 2006-04-10
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

    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:

    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.
    LVL 2

    Accepted Solution

    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.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    I'm currently working for a company where I have to upgrade over 50 VB6 programs to VB.NET 2008.  So far I'm about half way through, and I've learned quite a few tricks that drastically improve the performance of VB.NET apps. Because there are a…
    Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

    760 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

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now