hi andrew,

but surely these long stacktraces are not meant for users ;-)

what i have got from your statement is something like this

SQLException
|__DatabaseException
|____ApplicationException

finally, this ApplicationException is what is being thrown into execute()
call.

May i am novice, but I still need to be convinced about throwing so many
exceptions in chain

Can't the stuff be handled in a simple way --
SAY
a. when you get SQLException, catch and return NULL
b. Calling Class __ifs__ for NULL instead of __catching__ and transfer the
control accordingly.

Is there something i am ignoring?

regards
Navjot Singh

----- Original Message -----
From: "Andrew Hill" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, April 03, 2003 3:49 PM
Subject: RE: Where to catch/throw Exceptions in Struts Tiered Architecture


| I use nested exceptions, and virtually all my methods (and thus layers)
| catch and wrap and throw...
| Makes for some impressively long stacktraces - and is marvellous for
| debugging! :-)
|
|
| -----Original Message-----
| From: Navjot Singh [mailto:[EMAIL PROTECTED]
| Sent: Thursday, 3 April 2003 18:05
| To: Struts Users List
| Subject: Where to catch/throw Exceptions in Struts Tiered Architecture
|
|
| Hi,
|
| Take a simple case.
|
|    Action
|       Y
| UserAction -> User -> Database
|       |
|      V
|   user.jsp
|
| Say, Database throws exception. What is best way to handle exception?
|
| 1. Catch in User class and return NULL / some ErrorObject to UserAction
and
| let UserAction decide how to handle it?
|
| 2. Let User class __pass on__ the Exception from Database to UserAction.
|
| 2a. As execute() is already throwing Exception so it will handle ALL so
Set
| <global-exception> handler that can send the user to some nice page?
| 2b. Catch Exception in UserAction and then do some thing ...
|
| Which one do you guys follow in not-so-large scale web applications?
|
| would appreciate any comments.
| -navjot singh
|
|
|
|
| ---------------------------------------------------------------------
| To unsubscribe, e-mail: [EMAIL PROTECTED]
| For additional commands, e-mail: [EMAIL PROTECTED]
|
|
| ---------------------------------------------------------------------
| To unsubscribe, e-mail: [EMAIL PROTECTED]
| For additional commands, e-mail: [EMAIL PROTECTED]
|
|


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to