passing errors from model?

2004-03-23 Thread Nick Wesselman
Say my model does some validation of business rules. What's the best way to communicate those errors to the controller, and then (in the case of struts) translate those into ActionError's? It seems that if I want to communicate specific errors, creating Exception's for each case might be

Re: passing errors from model?

2004-03-23 Thread Greg Reddin
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 {