Class ErrorAccessDeniedExceptionConverter
java.lang.Object
com.totvs.tjf.api.response.error.converter.ErrorExceptionConverter
com.totvs.tjf.api.response.error.converter.ErrorAccessDeniedExceptionConverter
AccessDeniedException and ApiError converter to
ApiErrorResponse.- Author:
- Marcos Paulo dos Santos
-
Nested Class Summary
Nested classes/interfaces inherited from class com.totvs.tjf.api.response.error.converter.ErrorExceptionConverter
ErrorExceptionConverter.ExceptionErrorMap -
Field Summary
Fields inherited from class com.totvs.tjf.api.response.error.converter.ErrorExceptionConverter
API_ERROR_NULL_ERROR_MESSAGE, EXCEPTION_NULL_ERROR_MESSAGE -
Constructor Summary
ConstructorsConstructorDescriptionErrorAccessDeniedExceptionConverter(com.totvs.tjf.core.i18n.I18nService i18nService) -
Method Summary
Modifier and TypeMethodDescriptionconvert(org.springframework.security.access.AccessDeniedException exception) Converts the givenAccessDeniedExceptionto anErrorExceptionConverter.ExceptionErrorMapcontaining theHttpStatusand theApiErrorResponsewith: HttpStatus:FORBIDDEN; ApiErrorMessage: Code:Enum.name; Message:HttpStatus.getReasonPhrase(); and Detailed message:Throwable.getLocalizedMessage().Methods inherited from class com.totvs.tjf.api.response.error.converter.ErrorExceptionConverter
convert, convertAsError, convertAsError, convertAsGeneric
-
Constructor Details
-
ErrorAccessDeniedExceptionConverter
public ErrorAccessDeniedExceptionConverter(com.totvs.tjf.core.i18n.I18nService i18nService)
-
-
Method Details
-
convert
public ErrorExceptionConverter.ExceptionErrorMap convert(org.springframework.security.access.AccessDeniedException exception) Converts the givenAccessDeniedExceptionto anErrorExceptionConverter.ExceptionErrorMapcontaining theHttpStatusand theApiErrorResponsewith:- HttpStatus:
FORBIDDEN; - ApiErrorMessage:
- Code:
Enum.name; - Message:
HttpStatus.getReasonPhrase(); and - Detailed message:
Throwable.getLocalizedMessage().
- Code:
- Parameters:
exception- exception to be converted- Returns:
- instance of
ErrorExceptionConverter.ExceptionErrorMap
- HttpStatus:
-