FINERACT-824:
Removed the second validation since realCause.getCause() is null if it is equal to realCause
This commit is contained in:
committed by
Michael Vorburger ⛑️
parent
54b7ddf210
commit
efb0a558c8
+2
-2
@@ -1036,12 +1036,12 @@ public void checkForProductMixRestrictions(final Loan loan) {
|
|||||||
*/
|
*/
|
||||||
private void handleDataIntegrityIssues(final JsonCommand command, final Throwable realCause, final Exception dve) {
|
private void handleDataIntegrityIssues(final JsonCommand command, final Throwable realCause, final Exception dve) {
|
||||||
|
|
||||||
if (realCause.getMessage().contains("loan_account_no_UNIQUE") || realCause.getCause().getMessage().contains("loan_account_no_UNIQUE")) {
|
if (realCause.getMessage().contains("loan_account_no_UNIQUE") || (realCause.getCause() != null && realCause.getCause().getMessage().contains("loan_account_no_UNIQUE"))) {
|
||||||
|
|
||||||
final String accountNo = command.stringValueOfParameterNamed("accountNo");
|
final String accountNo = command.stringValueOfParameterNamed("accountNo");
|
||||||
throw new PlatformDataIntegrityException("error.msg.loan.duplicate.accountNo", "Loan with accountNo `" + accountNo
|
throw new PlatformDataIntegrityException("error.msg.loan.duplicate.accountNo", "Loan with accountNo `" + accountNo
|
||||||
+ "` already exists", "accountNo", accountNo);
|
+ "` already exists", "accountNo", accountNo);
|
||||||
} else if (realCause.getMessage().contains("loan_externalid_UNIQUE") || realCause.getCause().getMessage().contains("loan_externalid_UNIQUE")) {
|
} else if (realCause.getMessage().contains("loan_externalid_UNIQUE") || (realCause.getCause() != null && realCause.getCause().getMessage().contains("loan_externalid_UNIQUE"))) {
|
||||||
final String externalId = command.stringValueOfParameterNamed("externalId");
|
final String externalId = command.stringValueOfParameterNamed("externalId");
|
||||||
throw new PlatformDataIntegrityException("error.msg.loan.duplicate.externalId", "Loan with externalId `" + externalId
|
throw new PlatformDataIntegrityException("error.msg.loan.duplicate.externalId", "Loan with externalId `" + externalId
|
||||||
+ "` already exists", "externalId", externalId);
|
+ "` already exists", "externalId", externalId);
|
||||||
|
|||||||
Reference in New Issue
Block a user