Create User-Defined Exceptions

User-Defined Exceptions in C# vb.net asp.net

Exception handling features help you deal with any unexpected or exceptional situations that occur when a program is running. If you want users to be able to programmatically distinguish between some error conditions, you should create your own custom exceptions. It will simplify and improve the error handling and thus increase the overall code quality. Generally, for large scale projects , one should define custom exceptions.

How to create a custom exception ?

The following program shows how to create a custom exception.


C# Custom Exception Handling



Explanation :

How to handle custom exception in c#

Throw exception with out message



Throw exception with simple message


VB.Net Custom Exception Handling



Explanation :

How to handle custom exception in vb.net

Throw exception with out message



Throw exception with simple message

Exception Handling

Exceptions are the occurrence of some condition that changes the normal flow of execution. In .NET languages , Structured Exceptions handling is a fundamental part of Common Language Runtime. More about.... Exception Handling

System level Exceptions Vs Application level Exceptions

Exceptions are provide a structured, uniform, and type-safe way of controlling both system level and application level abnormal conditions. Application exceptions can be user defined exceptions thrown by the application. System exceptions are common exceptions thrown by the CLR. More about.... System level Exceptions VS ..

Difference between Exception and Error

Exceptions are related to the application and an Error is related to the environment in which the application is running. More about.... Exception and Error



NEXT.....Throwing Exceptions