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


Please Help Members By Posting Answers For Below Questions

What you mean by inner exception in c#?

619


Is everything an object c#?

576


Why do we need ienumerable in c#?

565


Does c# support multiple inheritance (mi)?

612


What is append in c#?

557






Explain metadata in c#.

579


Are arrays immutable c#?

606


What happens if a static constructor throws an exception?

578


Why do we use namespace in c#?

605


What are callback methods in c#?

595


Explain About sn.exe

585


Why main is static in c#?

641


How garbage collection deals with circular references.

541


What is nullable types in c#?

591


Can I use ReaderWriterLock instead of Monitor.Enter/Exit for Threading?

601