Welcome to Questionaries, where you can ask questions and receive answers from other members of the community.

Let us know at info@questionaries.org

Why is catch(Exception) almost always a bad idea?

5 like 0 dislike
Why is catch(Exception) almost always a bad idea?
asked 1 year ago by daneim (127,080 points)

1 Answer

1 like 0 dislike
 
Best answer
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.
answered 1 year ago by marck_don (191,010 points)

Related questions

3 like 0 dislike
1 answer
4 like 0 dislike
1 answer
4 like 0 dislike
1 answer
2 like 0 dislike
1 answer
2 like 0 dislike
1 answer
asked 1 year ago by daneim (127,080 points)