Merge pull request #998 from lingalamadhukar/MIFOSX-1396

MIFOSX-1396 Delete code displaying dataintegration issue
This commit is contained in:
Vishwas Babu A J
2014-07-03 15:04:59 -07:00
@@ -152,6 +152,9 @@ public class CodeValueWritePlatformServiceJpaRepositoryImpl implements CodeValue
.build();
} catch (final DataIntegrityViolationException dve) {
logger.error(dve.getMessage(), dve);
final Throwable realCause = dve.getMostSpecificCause();
if (realCause.getMessage().contains("code_value")) { throw new PlatformDataIntegrityException("error.msg.codeValue.in.use",
"This code value is in use", codeValueId); }
throw new PlatformDataIntegrityException("error.msg.code.value.unknown.data.integrity.issue",
"Unknown data integrity issue with resource: " + dve.getMostSpecificCause().getMessage());
}