Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

Answers were Sorted based on User's Feedback



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

Answer / supratim sengupta

Actually throwing your own exceptions is an excellent way
to handle various exceptions the way you want it to handle.
You can centralize the whole exception handling. It could
be useful in product development where you might miss out
some exception conditions and then you can always write a
common custom exception handler that can shoot you an email
with all the details of the exception.

Is This Answer Correct ?    8 Yes 1 No

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

Answer / guest

Not necessarily. If you're writing a library of code to be
used by other clients you don't always know the right thing
to do if an exceptional problem comes up. So it isn't always
a bad idea to throw your own exceptions.

Is This Answer Correct ?    5 Yes 2 No

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

Answer / guest

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

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

Answer / japan shha

Perhaps what you meant to ask was "When is it not necessarily a good idea to throw my own exception?"

http://stackoverflow.com/questions/2215112/why-is-it-a-bad-idea-to-throw-your-own-exceptions

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Sharp Interview Questions

What is the difference between iqueryable and ienumerable?

0 Answers  


What is the purpose of constructor in c#?

0 Answers  


What is event sourcing in c#?

0 Answers  


can you allow a class to be inherited, but prevent the method from being over-ridden?

0 Answers   Siebel Systems,


What is the use of ispostback in c#?

0 Answers  


Can you declare a field readonly?

0 Answers  


What is Delegate and what is it used for ?

0 Answers   NA,


Why we use methods in c#?

0 Answers  


How will U encapsulate button trigger event into text_box event of Pressing Enter key?i.e only after pressing Enter after the text is typed the button trigger event should activate?

6 Answers   TCS,


How do you achieve polymorphism in c#?

0 Answers  


Can you override private virtual methods?

5 Answers  


Is double a decimal?

0 Answers  


Categories