Why is it a bad idea to throw your own exceptions?
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
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 |
What is difference between string and stringbuilder in c#?
What tool we have to use to install assembli in gac folder.
Differentiate between response.expires and response.expiresabsolute?
Why do we use anonymous method in c#?
How many bits is int32?
Explain manifest & metadata?
What is namespace give the example?
What is a sealed class?
What is use of a HashTable in .NET?
Is java better than c#?
What is the difference between add and addrange in c#?
Hai, I want to open a new form while the previous form is hiding or closing. I tried this with using MDI.I created one form like ParentForm.placed one button control.when clicked one that it opend new form like ChildForm.When i set the property of ChildForm to Maximize,but the ParentForm button control also appearing on the childform. so plz help me how to hide parentform controls(hide parentform while it is childform opened) thanq..