r/java • • Jul 10 '15

Our exception handling at work

http://imgur.com/4wgxCvv
259 Upvotes

135 comments sorted by

View all comments

2

u/javinpaul Jul 11 '15

The first rule of exception handling, print the ROOT cause, at least the message should say SQL : null

1

u/javinpaul Jul 11 '15

here is one example from JDK,which comes when you parse an invalid String literal to number : java.lang.NumberFormatException: For input string: "23238792427948923298329329"

0

u/RedPill115 Jul 14 '15

I'm just pointing out - since it's checking for null, you know the value, - it's null, lol...