Parag,
In addition to Mike's comments.
To define your own exceptions simply inherit from
System.ApplicationException or System.SystemException.
You can inherit from System.Exception itself, however that is not
recommended.
You may want to consider defining MyBaseException that all your user
exceptions inherit from.
For the .NET guidelines on creating exceptions see:
http://msdn.microsoft.com/library/de...Guidelines.asp
Hope this helps
Jay
"Parag" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi,
>
> I am writing error handling mechanism for a large website and one of
> the requirements that has come is whether it is possible to have the
> .NET application whenever it throws exception it throws a custom
> defined exception. For e.g.
> Default behaviour is as shown:
> Try
> some code
> Catch Ex as Exception
>
> End try
>
> Can I have something like for all types of exceptions
>
> Try
> some code
> Catch Ex as MyException
>
> End try
>
> This should be the default behaviour of my .NET application
>
> Regards
>
> Parag