We throw a CustomException and catch it in the webtier.This
is then forwarded to a Error jsp page which takes the
error message(user friendly) and the possible
reasons(From Property File for each type of Exception) and
displays it on the page.


Chandra

-----Original Message-----
From: A mailing list for Enterprise JavaBeans development
[mailto:[EMAIL PROTECTED]]On Behalf Of Dmitri Colebatch
Sent: Thursday, March 21, 2002 11:58 AM
To: [EMAIL PROTECTED]
Subject: what to do with exceptions


hey everyone,

something thats been in the back of my head for a while.

what do ppl do with the various exceptions thrown in EJB?  Specifically, in
the web tier.  typical scenario, some code in the web
tier needs to create a SLSB, and invoke a method on it.  In the SLSB, the
invoking of that method has to deal with another 3-4 EJB
exceptions.  So, do you

  a) catch them, and rethrow them as your own custom exception type
  b) catch them, and rethrow them as a runtime exception
  c) just add them to the throws clause

and then in the web tier, do you handle these exceptions each individually,
or do you just let the 500 error page pick them up
(assuming you have a nice one).

I'm always inclined to do (b), as the only time I ever see them is in
development when I've made an error... its unlikely I'm going
to be able to deal with them gracefully anyway, so it seems logical -
however, at the same time I've got the voice in the back of my
head telling me I'm being lazy...

be interested to hear other ppl's thoughts on this.

cheers
dim

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to