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

WHAT IS THE EXACT USE OF INTERFACE(DONT TELL USE FOR MULTIPLE INHERITANCE)

5 Answers   eXensys,


What is a linq in c#?

0 Answers  


Do void methods have parameters?

0 Answers  


How you will create satellite assemblies?

0 Answers  


What is property c#?

0 Answers  






What is difference between float and decimal?

0 Answers  


What is a sealed class?

0 Answers  


Can abstract class be sealed?

0 Answers  


What is the difference between a variable and a literal?

0 Answers  


What is c# used for in the industry?

0 Answers  


How do you inherit from a class in C#?

1 Answers  


Explain metadata in c#.

0 Answers  


Categories