Why is catch(Exception) almost always a bad idea?

Answer Posted / nagaraj

Catch(Exception) means that you catch all the exception
which might not occur. But, really we need to catch only
some type of exception, so we need to catch only those type
instead of catching all the exceptions.

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

there is two functions function a and function b like fun a(){.... ..... } fun b() { } in function b i write the coding to add two numbers and i need to dispaly the sum result in function a with out using global variable. how we do?

2537


Can I stream live content/events?

762


What are the best practices to follow to secure connection strings in an ASP.NET web application?

753


What is state management in .net?

792


List the types of authentication supported by asp.net?

704






Differentiate between a hyperlink control and a linkbutton control.

713


How can I open ashx file in mobile?

816


What is a gridview in asp.net?

718


What is the difference between server-side scripting and client-side scripting?

727


From which base class all web forms are inherited?

683


Explain the updatepanel?

768


What is difference between asp state management and asp.net state management?

781


What is globalization and localization in asp net?

675


What is the difference between a cookie and a pixel?

642


What is server infrastructure?

785