You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Greg Reddin <gr...@fnf.com> on 2004/03/23 12:36:50 UTC

Re: passing errors from model?

Nick Wesselman wrote:
> create a custom Exception with a set of 
> error codes and messages?

This is what we've done in the past.  We'd assign a set of error codes 
in the ApplicationResources file. and throw an exception like this:

throw new MyException("12345", ...);

And catch it like this:

try {
  ....
} catch (MyException e) {
   errors.addError(new ActionMessage(e.getErrorCode());
}

That may not be completely correct, but something similar to that.

Greg

> 
> Any thoughts? How do others handle this?
> 
> Nick
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 


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