Programming Tip for the day – Hiding Exceptions

Hello Programmers,

 

Hiding exceptions is a sin.  Don’t do it unless you want to be tagged as a bad developer.

If you don’t understand what I am talking about, here is the code snippet.

try catch

Try catch

try

{

int i = 10/0;

}

catch(Exception e)

{

//Do Nothing – Please don’t do this!!

}

 

Moral: Always throw the exceptions and log them.  It will get incredibly hard to spot the issue while debugging if you try to hide the exceptions.

You may also like...

0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x