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

Define c# i/o classes? List the commonly used classes?

537


What are different types of classes in c#?

476


What is the difference between array and arraylist c#?

454


How objects are stored in memory?

494


Is equal in c#?

500






What is the difference between new and override in c#?

543


How is the syntax written to inherit from a class in C#?Give an example ?

532


What are the Types of JIT and what is econo-JIT

792


Is c# scripting language?

499


explain the nature of the assembly work?

2095


Are c# constructors the same as c++ constructors?

512


What is the use of protected in c#?

487


How do partial classes work in c#?

478


What is float in unity?

497


Define boxing and unboxing in c#?

470