From 8edf49e689ed6ac97eec9d1c3ff1e27143d4a230 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Soma=20S=C3=B6r=C3=B6s?= Date: Fri, 6 Jun 2025 14:19:33 +0200 Subject: [PATCH] FINERACT-2304: Fix SynchronousCommandProcessingService retry error handling around execute command --- .../service/SynchronousCommandProcessingService.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/fineract-core/src/main/java/org/apache/fineract/commands/service/SynchronousCommandProcessingService.java b/fineract-core/src/main/java/org/apache/fineract/commands/service/SynchronousCommandProcessingService.java index 10dfcd183..37250c475 100644 --- a/fineract-core/src/main/java/org/apache/fineract/commands/service/SynchronousCommandProcessingService.java +++ b/fineract-core/src/main/java/org/apache/fineract/commands/service/SynchronousCommandProcessingService.java @@ -83,14 +83,14 @@ public class SynchronousCommandProcessingService implements CommandProcessingSer private final Gson gson = GoogleGsonSerializerHelper.createSimpleGson(); private CommandProcessingResult retryWrapper(Supplier supplier) { - if (!BatchRequestContextHolder.isEnclosingTransaction()) { - try { + try { + if (!BatchRequestContextHolder.isEnclosingTransaction()) { return retryConfigurationAssembler.getRetryConfigurationForExecuteCommand().executeSupplier(supplier); - } catch (RuntimeException e) { - fallbackExecuteCommand(e); } + return supplier.get(); + } catch (RuntimeException e) { + return fallbackExecuteCommand(e); } - return supplier.get(); } @Override @@ -204,7 +204,7 @@ public class SynchronousCommandProcessingService implements CommandProcessingSer fineractRequestContextHolder.setAttribute(IDEMPOTENCY_KEY_STORE_FLAG, flag); } - public void fallbackExecuteCommand(Exception e) { + public CommandProcessingResult fallbackExecuteCommand(Exception e) { throw ErrorHandler.getMappable(e); }