Grokbase Groups Cayenne dev July 2007
FAQ
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

Search Discussions

Discussion Posts

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 3 | next ›
Discussion Overview
groupdev @
categoriescayenne
postedJul 9, '07 at 10:06a
activeJul 10, '07 at 9:20a
posts3
users3
websitecayenne.apache.org

People

Translate

site design / logo © 2022 Grokbase