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 tostring() vs convert.tostring() vs (string) cast
So what makes your code really object-oriented #?
Is there regular expression (regex) support available to c# developers?
What is data hiding in c#?
How do I unload an assembly?
How do I get deterministic finalization in c#?
What is string in c# net?
Can constructor have return type c#?
What is gui in c#?
What is a nested type. Give an example?
What issues can be faced while delivering code?
In which order the destructor is called for an inherited class?
What is encapsulation in csharp?
What is the implicit name of the parameter that gets passed into the class set method?
How to use delegates with events?