update default error message for fund data integrity constraints.
This commit is contained in:
@@ -30,6 +30,7 @@ public class Fund extends AbstractAuditableCustom<AppUser, Long> {
|
||||
}
|
||||
|
||||
protected Fund() {
|
||||
//
|
||||
}
|
||||
|
||||
private Fund(final String fundName, final String externalId) {
|
||||
|
||||
+2
-2
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user