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
What is difference between C# and VB.NET?
What is an arraylist in c#?
What are the 2 kinds of data type conversions in c#?
What is sealed class in c#?
Illustrate namespaces in c#?
Where do we use static class in c#?
Does c# have a 'throws' clause?
What do you mean by serialization in .NET?
What is the c# equivalent of c++ catch (…), which was a catch-all statement for any possible exception? Does c# support try-catch-finally blocks?
Can a private virtual method can be overridden?
What is final keyword in c#?
What is the concept of strong names?
What is the use of list in c#?
What is an enumerator in c#?
Can you call from an inherited constructor to a specific base constructor if both base class and an inheriting class has a number of overloaded constructors?