Class ApiHttpClientPermissionErrorExceptionHandler
java.lang.Object
com.totvs.tjf.api.response.error.handler.ApiHttpClientPermissionErrorExceptionHandler
@Order(-2147483648)
@ControllerAdvice(annotations=com.totvs.tjf.api.context.stereotype.ApiGuideline.class)
public final class ApiHttpClientPermissionErrorExceptionHandler
extends Object
HttpClientPermissionErrorException interceptor to adjust its contents
as an ApiErrorResponse according to TOTVS API Guideline. Note: This advice has
Ordered.HIGHEST_PRECEDENCE- Author:
- Marcos Paulo dos Santos
-
Constructor Summary
ConstructorsConstructorDescriptionApiHttpClientPermissionErrorExceptionHandler(ErrorHttpClientPermissionErrorExceptionConverter converter) -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<com.totvs.tjf.api.context.response.ApiErrorResponse>handler(com.totvs.tjf.core.security.exception.HttpClientPermissionErrorException exception) Generic handler forHttpClientPermissionErrorExceptionto adjust its content toApiErrorResponseto be serialized according to the TOTVS API Guideline.
-
Constructor Details
-
ApiHttpClientPermissionErrorExceptionHandler
public ApiHttpClientPermissionErrorExceptionHandler(ErrorHttpClientPermissionErrorExceptionConverter converter)
-
-
Method Details
-
handler
@ExceptionHandler(com.totvs.tjf.core.security.exception.HttpClientPermissionErrorException.class) public org.springframework.http.ResponseEntity<com.totvs.tjf.api.context.response.ApiErrorResponse> handler(com.totvs.tjf.core.security.exception.HttpClientPermissionErrorException exception) Generic handler forHttpClientPermissionErrorExceptionto 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 withINTERNAL_SERVER_ERROR.The returned status code will be the contained in the
HttpClientPermissionErrorException.- Parameters:
exception- to be handled- Returns:
- an
ApiErrorResponseto be serialized - See Also:
-
ExceptionHandlerErrorExceptionConverter.convert(Exception)
-