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

How do you secure a webservice?

1 Answers   TCS,


What are the types in c#?

0 Answers  


Are arrays immutable c#?

0 Answers  


When can a derived class override a base class member?

0 Answers  


Is string a class in c#?

0 Answers  






ctype(123.34,integer) - should it throw an error? Why or why not?

2 Answers   Wipro,


What are types in c#?

0 Answers  


Can two catch blocks be executed?

13 Answers  


What is a resource? Provide an example from your recent project.

2 Answers   IBM, Logica CMG, Wipro,


What does it mean?

0 Answers  


Why do we need interfaces?

2 Answers   HCL,


What is type safe code?

0 Answers  


Categories