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

How do I create a delegate/multicastdelegate?

549


What is sqldatareader c#?

489


How do I enforce const correctness in c#?

534


What is jit? What are the different types of jit?

571


What are delegate methods?

470






how to insert the data from the grid view to database table though button click.pls send the answer to mail id suri1319@gmail.com

1495


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

465


explain the three services model commonly know as a three-tier application.

549


Can abstract class have constructor?

502


What is the difference between properties and indexer in c#?

439


Explain the difference between a sub and a function in c#.

532


Which are the loop types available in c#?

497


How is exception handling implemented in c#?

583


What is default parameter in c#?

510


What does type safety mean?

578