update default error message for fund data integrity constraints.

This commit is contained in:
Keith Woodlock
2012-08-23 10:49:14 +01:00
parent 3cd3b487f3
commit 17ba21d302
2 changed files with 3 additions and 2 deletions
@@ -30,6 +30,7 @@ public class Fund extends AbstractAuditableCustom<AppUser, Long> {
}
protected Fund() {
//
}
private Fund(final String fundName, final String externalId) {
@@ -81,9 +81,9 @@ public class FundWritePlatformServiceJpaRepositoryImpl implements FundWritePlatf
Throwable realCause = dve.getMostSpecificCause();
if (realCause.getMessage().contains("fund_externalid_org")) {
throw new PlatformDataIntegrityException("error.msg.fund.duplicate.externalId", "Fund with externalId {0} already exists", "externalId", command.getExternalId());
throw new PlatformDataIntegrityException("error.msg.fund.duplicate.externalId", "A fund with external id '" + command.getExternalId() + "' already exists", "externalId", command.getExternalId());
} else if (realCause.getMessage().contains("fund_name_org")) {
throw new PlatformDataIntegrityException("error.msg.fund.duplicate.name", "Fund with name {0} already exists", "name", command.getName());
throw new PlatformDataIntegrityException("error.msg.fund.duplicate.name", "A fund with name '" + command.getExternalId() + "' already exists", "name", command.getName());
}
logger.error(dve.getMessage(), dve);