Is it a web application or a stand alone java application? You can capture the RuntimeException at the top level where you can log it with full stack trace, etc. Spring and Hibernate 3 uses runtime exceptions. [ May 14, 2008: Message edited by: arulk pillai ]
If you look in "Thinking in Java" by Bruce Eckel, you find he changes his mind between the 3rd and 4th editions. He now recommends Exception chaining just like what you have shown. Might be better to create our own Exception so you can write
I guess your statement 'I don't want to put "throws DaoException" in every one of my method declarations, but the exception still has to propagate to the user.' answers it. This sort of chaining will be useful in cases where we cant recover from exceptions but still would like to propagate it without the hassle of having the caller methods having to declare throws clauses for the checked exception. Maybe we can use our own custom runtime exceptions if needed, as stated in one of the posts.
Run away! Run away! Here, take this tiny ad with you:
Sauce Labs - World's Largest Continuous Testing Cloud for Websites and Mobile Apps