This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes What exception to use? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "What exception to use?" Watch "What exception to use?" New topic

What exception to use?

Sharon whipple
Ranch Hand

Joined: Jul 31, 2003
Posts: 294
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

Campbell Ritchie

Joined: Oct 13, 2005
Posts: 36482
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.
I agree. Here's the link:
subject: What exception to use?
Similar Threads
exam lab q-9(excepton handling)
Exception Handling
Exception Question
catch Throwable
true or false?