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 do you mean by shared assembly?

582


What is data quality assurance?

441


What is boxing & unboxing?

564


Why singleton pattern is used in c#?

532


i want o/p 011242110 in c# code.

1628






What is view model in c#?

459


Why is it efficient to use System.string under System.Text.StringBuilder ?

521


Why is lazy loading?

494


When is a class declared as a class abstract?

580


What is interface used in c#?

581


What is the difference between field and variable in c#?

459


Why do we need a singleton class?

500


Can you declare struct members as protected?

494


What is the difference between User controls and Custom Controls?

547


What is the keyword used to prevent a class from being inherited by another class?

663