diff --git a/fineract-core/src/main/java/org/apache/fineract/batch/exception/ErrorHandler.java b/fineract-core/src/main/java/org/apache/fineract/batch/exception/ErrorHandler.java index f8efb0867..ed172df98 100644 --- a/fineract-core/src/main/java/org/apache/fineract/batch/exception/ErrorHandler.java +++ b/fineract-core/src/main/java/org/apache/fineract/batch/exception/ErrorHandler.java @@ -71,12 +71,12 @@ public final class ErrorHandler { runtimeException -> handleException(runtimeException, new PlatformDataIntegrityExceptionMapper(), 3001)); EXCEPTION_HANDLERS.put(AbstractPlatformDomainRuleException.class, runtimeException -> handleException(runtimeException, new PlatformDomainRuleExceptionMapper(), 9999)); - EXCEPTION_HANDLERS.put(TransactionException.class, runtimeException -> new ErrorInfo(HttpStatus.SC_BAD_REQUEST, 4001, + EXCEPTION_HANDLERS.put(TransactionException.class, runtimeException -> new ErrorInfo(HttpStatus.SC_INTERNAL_SERVER_ERROR, 4001, "{\"Exception\": %s}".formatted(runtimeException.getMessage()))); EXCEPTION_HANDLERS.put(PlatformInternalServerException.class, runtimeException -> handleException(runtimeException, new PlatformInternalServerExceptionMapper(), 5001)); - EXCEPTION_HANDLERS.put(NonTransientDataAccessException.class, runtimeException -> new ErrorInfo(HttpStatus.SC_BAD_REQUEST, 4002, - "{\"Exception\": %s}".formatted(runtimeException.getMessage()))); + EXCEPTION_HANDLERS.put(NonTransientDataAccessException.class, runtimeException -> new ErrorInfo(HttpStatus.SC_INTERNAL_SERVER_ERROR, + 4002, "{\"Exception\": %s}".formatted(runtimeException.getMessage()))); EXCEPTION_HANDLERS.put(DEFAULT_ERROR_HANDLER.getKey(), DEFAULT_ERROR_HANDLER.getValue()); } diff --git a/integration-tests/src/test/java/org/apache/fineract/integrationtests/BatchApiTest.java b/integration-tests/src/test/java/org/apache/fineract/integrationtests/BatchApiTest.java index eac30e78f..471d5bc32 100644 --- a/integration-tests/src/test/java/org/apache/fineract/integrationtests/BatchApiTest.java +++ b/integration-tests/src/test/java/org/apache/fineract/integrationtests/BatchApiTest.java @@ -199,7 +199,7 @@ public class BatchApiTest { // Asserts that all the transactions have been successfully rolled back Assertions.assertEquals(1, response.size()); - Assertions.assertEquals((long) 400, (long) response.get(0).getStatusCode(), "Verify Status code 400"); + Assertions.assertEquals((long) 500, (long) response.get(0).getStatusCode(), "Verify Status code 500"); } /**