You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by David Graham <dg...@hotmail.com> on 2003/02/04 02:25:19 UTC

Standard Actions Sending Errors

Is it appropriate for the standard actions to call response.sendError(... or 
would it be better for them to throw various types of Exceptions?  It seems 
like it would be more flexible to throw exceptions now that we have 
declarative exception handling.  This would allow the client programmer to 
determine what to do with the exception, which might include sending an 
error code to the user.

I came across this issue while looking at the different ways 
LookupDispatchAction and DispatchAction handle errors.

Would it be backwards incompatible to change what the actions do when they 
encounter an error?

Thanks,
Dave





_________________________________________________________________
Add photos to your e-mail with MSN 8. Get 2 months FREE*.  
http://join.msn.com/?page=features/featuredemail


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org


Re: Standard Actions Sending Errors

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Mon, 3 Feb 2003, David Graham wrote:

> Date: Mon, 03 Feb 2003 18:25:19 -0700
> From: David Graham <dg...@hotmail.com>
> Reply-To: Struts Developers List <st...@jakarta.apache.org>
> To: struts-dev@jakarta.apache.org
> Subject: Standard Actions Sending Errors
>
> Is it appropriate for the standard actions to call response.sendError(... or
> would it be better for them to throw various types of Exceptions?  It seems
> like it would be more flexible to throw exceptions now that we have
> declarative exception handling.  This would allow the client programmer to
> determine what to do with the exception, which might include sending an
> error code to the user.
>

For 1.1, it makes sense to me that we declare a couple of specific
exceptions that can then be caught and managed using the exception mapping
technology.

> I came across this issue while looking at the different ways
> LookupDispatchAction and DispatchAction handle errors.
>
> Would it be backwards incompatible to change what the actions do when they
> encounter an error?
>

I suspect that the current behavior w.r.t. errors is so unusable that
anyone concerned about it has already subclassed the thing anyway.

+1 for defining appropriate exceptions that can be thrown for this use
case.

> Thanks,
> Dave

Craig


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org