FINERACT-2304: Fix SynchronousCommandProcessingService retry error handling around execute command

This commit is contained in:
Soma Sörös
2025-06-06 18:42:53 +02:00
committed by Arnold Gálovics
parent 19b2a77127
commit 8edf49e689
@@ -83,14 +83,14 @@ public class SynchronousCommandProcessingService implements CommandProcessingSer
private final Gson gson = GoogleGsonSerializerHelper.createSimpleGson(); private final Gson gson = GoogleGsonSerializerHelper.createSimpleGson();
private CommandProcessingResult retryWrapper(Supplier<CommandProcessingResult> supplier) { private CommandProcessingResult retryWrapper(Supplier<CommandProcessingResult> supplier) {
if (!BatchRequestContextHolder.isEnclosingTransaction()) { try {
try { if (!BatchRequestContextHolder.isEnclosingTransaction()) {
return retryConfigurationAssembler.getRetryConfigurationForExecuteCommand().executeSupplier(supplier); return retryConfigurationAssembler.getRetryConfigurationForExecuteCommand().executeSupplier(supplier);
} catch (RuntimeException e) {
fallbackExecuteCommand(e);
} }
return supplier.get();
} catch (RuntimeException e) {
return fallbackExecuteCommand(e);
} }
return supplier.get();
} }
@Override @Override
@@ -204,7 +204,7 @@ public class SynchronousCommandProcessingService implements CommandProcessingSer
fineractRequestContextHolder.setAttribute(IDEMPOTENCY_KEY_STORE_FLAG, flag); fineractRequestContextHolder.setAttribute(IDEMPOTENCY_KEY_STORE_FLAG, flag);
} }
public void fallbackExecuteCommand(Exception e) { public CommandProcessingResult fallbackExecuteCommand(Exception e) {
throw ErrorHandler.getMappable(e); throw ErrorHandler.getMappable(e);
} }