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
Can an int be negative c#?
Can an exception be thrown from a catch block?
What is c# used for?
The int maps to which C# keyword in .NET type?
What does char mean in c#?
How does yield return work c#?
What is cli in c#?
What are the differences between value types and reference types?
Why abstraction is used in c#?
What does protected internal access modifier mean?
What is expression tree with example?
Why do we use dictionary in c#?
What are the properties in c#?
What are the different types of assemblies available and their purpose?
What are value types and reference types?