Thanks David,

So here is what i have observed and would like to do whenever i find a
printStackTrace() call in the catch block
1 . Remove the printStackTrace() statement
2. Throw an OpenEJBException wrapping the original exception.
3. Add an error message in the Messages.properties file of the respective
project and use the Messages class to format the message before adding it to
the OpenEJBException

Please let me know if the above is the right approach. If not, please let me
know.

On 1/7/07, David Blevins <[EMAIL PROTECTED]> wrote:


On Jan 7, 2007, at 6:41 PM, Karan Malhi wrote:

> also at some places I see e.printStackTrace() in the catch block.
> Is there
> any specific reason why we are printing the stack trace at some
> places,
> whereas throwing an OpenEJBException at some other places? What is the
> general exception handling strategy?

Probably anything that calls printStackTrace could stand some better
exception handling.

Ideally every exception would be very detailed, localized, nested and
the e.getMessage() text contain at least some hint of the nested
exception.  But obviously reality often falls short of that.

-David




--
Karan Malhi

Reply via email to