Why is it a bad idea to throw your own exceptions?



Why is it a bad idea to throw your own exceptions?..

Answer / daniel

Well, if at that point you know that an error has occurred,
then why not write the proper code to handle that error
instead of passing a new Exception object to the catch
block? Throwing your own exceptions signifies some design
flaws in the project.

Is This Answer Correct ?    3 Yes 2 No

Post New Answer

More C Sharp Interview Questions

Can we instantiate abstract class in c#?

0 Answers  


What is the Main difference between String and StringBuilder and why do we use StringBuilder.

15 Answers   Aditya, CTS, Siemens,


What's the difference between class and object?

0 Answers  


How do partial classes work in c#?

0 Answers  


What does dbml stand for?

0 Answers  






What does the keyword virtual mean in the method definition?

3 Answers   Ipog Software, Satyam, Visual Soft,


What is wpf c#?

0 Answers  


What is the difference between TypeOf, GetType and what are the uses of TypeOf, GetType.

2 Answers   Siemens, Syntel,


Is double a decimal?

0 Answers  


Is string reference type / value type?

56 Answers   Accenture, Microsoft, Siemens,


What is concatenation and when should it be used?

0 Answers  


Give 2 scenarios where static constructors can be used?

0 Answers  


Categories