FINERACT-1724: Internal server error when transaction related errors happen in batch executions
This commit is contained in:
committed by
Arnold Gálovics
parent
3b4b5e9109
commit
cf9d102e19
@@ -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());
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -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");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user