adamsaghy commented on code in PR #3933:
URL: https://github.com/apache/fineract/pull/3933#discussion_r1642540753
##########
fineract-core/src/main/java/org/apache/fineract/commands/service/CommandSourceService.java:
##########
@@ -64,8 +66,16 @@ public CommandSource
saveInitialSameTransaction(CommandWrapper wrapper, JsonComm
@NotNull
private CommandSource saveInitial(CommandWrapper wrapper, JsonCommand
jsonCommand, AppUser maker, String idempotencyKey) {
- CommandSource initialCommandSource = getInitialCommandSource(wrapper,
jsonCommand, maker, idempotencyKey);
- return commandSourceRepository.saveAndFlush(initialCommandSource);
+ try {
+ CommandSource initialCommandSource =
getInitialCommandSource(wrapper, jsonCommand, maker, idempotencyKey);
+ return commandSourceRepository.saveAndFlush(initialCommandSource);
+ } catch (JpaSystemException jse) {
+ final String message = (jse.getRootCause() != null) ?
jse.getRootCause().getMessage() : null;
+ if (message != null &&
message.contains("UNIQUE_PORTFOLIO_COMMAND_SOURCE")) {
Review Comment:
I reckon we need to slightly modify to work with MariaDB and Postgres as
well:
`message.toLowerCase().contains("unique_portfolio_command_source")`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]