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

Answer Posted / swapna

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 ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

If a.equals(b) is true then a.gethashcode & b.gethashcode must always return same hash code.

739


What is attribute and reflection in c#?

665


What is c sharp language?

696


Can we declare class as protected?

738


What is the full form of GAC? Explain its uses?

758


What is method overriding in c#

761


Can an int be negative c#?

770


Is 0 an unsigned integer?

646


What is the difference between IEnumerator and IEnumerable?

901


What is parallel foreach c#?

677


Explain the process of polymorphism with an example?

659


How do I stop my console from closing in c#?

644


What is data set in c#?

709


Is stringbuilder better than string?

697


Explain the types of errors in c#?

648