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
Is inheritance possible in c sharp?
Can a class be protected in c#?
Explain “static” keyword in c#?
Is it possible to force garbage collector to run?
How can I get around scope problems in a try/catch?
What are value types and reference types?
What are strings in c#?
What is anonymous methods in c#?
What is the difference between firstordefault and first?
What are the fundamental principles of oo programming?
Does unity use c++ or c#?
Are arraylist faster or arrays?
what is the difference between convert.tostring() and tostring() functions ?
What are fields in c#?
Is a games console a computer?