Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What exception to use?

 
Sharon whipple
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am running line of code that will execute Ejb remote/local method
I want to be sure that I will handle every exception possible
Should i use Throwable or RuntimeException whats the difference anyway?
Thank you
Sharon




 
Campbell Ritchie
Sheriff
Pie
Posts: 49729
69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to go through the Exceptions part of the Java tutorial. You should be catching anything your method declares in its javadoc or throws clause.
Not usually a good idea to try catching everything, but if you insist then catch Exception.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic