Validation exception messages in three tier are pretty unhelpful by
the time they get to the client. We've been extending them by adding
this to ValidationException:
/**
* Returns message that includes the details of the validation
failures.
*/
public String getMessage() {
String message = super.getMessage();
if (result.hasFailures()) {
message = message + " validation failures: ";
for (int i = 0; i < result.getFailures().size(); i++) {
message = message + ((ValidationFailure)
result.getFailures().get(i)).toString();
if (i < result.getFailures().size() - 1) {
message = message + ", ";
}
}
}
return message;
}
Any thoughts about side effects this might have for anyone?
As an aside, what would be even more helpful is if three tier
returned not a CayenneRuntimeException, but a ValidationException to
the client. I don't know if that is hard to change.
Ari
-------------------------->
ish
http://www.ish.com.au
Level 1, 30 Wilson Street Newtown 2042 Australia
phone +61 2 9550 5001 fax +61 2 9550 4001
GPG fingerprint CBFB 84B4 738D 4E87 5E5C 5EFA EF6A 7D2E 3E49 102A
This archive was generated by hypermail 2.0.0 : Mon Jul 09 2007 - 06:06:07 EDT