This is an automated email from the ASF dual-hosted git repository.

arnold pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract.git


The following commit(s) were added to refs/heads/develop by this push:
     new 8edf49e689 FINERACT-2304: Fix SynchronousCommandProcessingService 
retry error handling around execute command
8edf49e689 is described below

commit 8edf49e689ed6ac97eec9d1c3ff1e27143d4a230
Author: Soma Sörös <[email protected]>
AuthorDate: Fri Jun 6 14:19:33 2025 +0200

    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 10dfcd183f..37250c475b 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<CommandProcessingResult> 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);
     }
 

Reply via email to