473,386 Members | 1,693 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,386 software developers and data experts.

creating my own exception class

Hello!

If I want to create my own Exception class which class is the recommended
class to derive from.
Should it be from Exception or from System.ApplicationException.

//Tony

Sep 29 '08 #1
1 1631
On Mon, 29 Sep 2008 10:35:34 -0700, Tony Johansson
<jo*****************@telia.comwrote:
Hello!

If I want to create my own Exception class which class is the recommended
class to derive from.
Should it be from Exception or from System.ApplicationException.
You should only post the question once.

As for the answer, MSDN has this to say:

If you are designing an application that needs to create
its own exceptions, you are advised to derive custom exceptions
from the Exception class. It was originally thought that
custom exceptions should derive from the ApplicationException
class; however in practice this has not been found to add
significant value. For more information, see Best Practices for
Handling Exceptions
(http://msdn.microsoft.com/en-us/library/seyhszts.aspx)

Pete
Sep 29 '08 #2

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

Similar topics

0
by: SS | last post by:
Hi All, I am trying to create a simple DBException Class which I want to use in different apps. Here is what I am doing: 1. I Created a VB Class Imports...
6
by: DraguVaso | last post by:
Hi, In my application, on some given actions while debugging in Visual Studio, I suddenly get a "System.ComponentModel.Win32Exception was unhandled" Message="Error creating window handle."...
2
by: David Elliott | last post by:
I am creating a configuration class to read / write a standard configuration file. <?xml version="1.0" encoding="utf-8"?> <configuration> <appSettings> <add key="ConnectionString"...
15
by: Carlos Lozano | last post by:
Hi, What is the right way to create an OCX COM component. The component is already registerred, but can't create an instance. I am using the reference to the interop module created. If I use...
2
by: John | last post by:
Hi I am trying to find the way to create an email in outlook. I am using the code given at the end. It works fine the first time but calling the code second time gives the following error; ...
17
by: Lee Harr | last post by:
I understand how to create a property like this: class RC(object): def _set_pwm(self, v): self._pwm01 = v % 256 def _get_pwm(self): return self._pwm01 pwm01 = property(_get_pwm, _set_pwm)
2
by: astolpho | last post by:
I am using a slightly outdated reference book on J2EE programming. It gives 2 methods of creating a database used in its casestudies. The first is an ANT script that gives the following output: ...
0
by: harshal.borade | last post by:
I am using XmlSerializer with XmlAttributeOverrides. The XmlAttributeOverrides are used for properties which hold element/s derived from "AbstractMessage" type. ...
1
by: alex21 | last post by:
Ok i have never before tried networking in my programming, so this is the first time i have tried anything like this. But i am trying to make an application which acts as a medium between a server...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.