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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

Can an int be negative c#?

811


Can an exception be thrown from a catch block?

802


What is c# used for?

735


The int maps to which C# keyword in .NET type?

866


What does char mean in c#?

731


How does yield return work c#?

730


What is cli in c#?

728


What are the differences between value types and reference types?

825


Why abstraction is used in c#?

710


What does protected internal access modifier mean?

794


What is expression tree with example?

686


Why do we use dictionary in c#?

730


What are the properties in c#?

716


What are the different types of assemblies available and their purpose?

713


What are value types and reference types?

816