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