C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Articles » General »

General Catch Handler in C#


Posted Date: 06 Nov 2008    Resource Type: Articles    Category: General
Author: Shanthi MMember Level: Gold    
Rating: 1 out of 5Points: 3



General Catch Handler
A catch block which will catch any exception is called a general catch handler. A general catch handler does not specify any parameter and can be written as

try
{
// Statement which causes an exception
}

catch //No parameters
{
//Handles any type of exception
}

catch(Exception e) can handle all the exceptions thrown by the C# code and therefore can be used as a general catch handler.

If the program uses libraries written in other languages, then there may be an exception that is not derived from the class Exception. Such exceptions can be handled by the parameter-less catch statement.

This handler is always placed at the end. Since there is no parameter, it does not catch any information about the exception and therefore we do not know what went wrong.




Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
General Catch Handler in C#  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Difference Between Class and Struct
Previous Resource: Features of Business Intelligence
Return to Discussion Resource Index
Post New Resource
Category: General


Post resources and earn money!
 
Related Resources



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use