Class ApiTransactionSystemExceptionHandler
java.lang.Object
com.totvs.tjf.api.response.error.handler.ApiTransactionSystemExceptionHandler
@Order(-2147483648)
@ControllerAdvice(annotations=com.totvs.tjf.api.context.stereotype.ApiGuideline.class)
public final class ApiTransactionSystemExceptionHandler
extends Object
TransactionSystemException interceptor to adjust its contents as an
ApiErrorResponse according to TOTVS API Guideline. Note: This advice has
Ordered.HIGHEST_PRECEDENCE- Author:
- Rubens dos Santos Filho
-
Constructor Summary
ConstructorsConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<com.totvs.tjf.api.context.response.ApiErrorResponse>handler(org.springframework.transaction.TransactionSystemException exception) Generic handler forTransactionSystemExceptionto adjust its content toApiErrorResponseto be serialized according to the TOTVS API Guideline.
-
Constructor Details
-
ApiTransactionSystemExceptionHandler
-
-
Method Details
-
handler
@ExceptionHandler(org.springframework.transaction.TransactionSystemException.class) public org.springframework.http.ResponseEntity<com.totvs.tjf.api.context.response.ApiErrorResponse> handler(org.springframework.transaction.TransactionSystemException exception) Generic handler forTransactionSystemExceptionto adjust its content toApiErrorResponseto be serialized according to the TOTVS API Guideline.When the exception doesn't have an
ApiErrortheir content is going to be considered a generic error withBAD_REQUEST.- Parameters:
exception- to be handled- Returns:
- an
ApiErrorResponseto be serialized - See Also:
-
ExceptionHandlerErrorExceptionConverter.convert(Exception)
-