Class ErrorTransactionSystemExceptionConverter
java.lang.Object
com.totvs.tjf.api.response.error.converter.ErrorExceptionConverter
com.totvs.tjf.api.response.error.converter.ErrorConstraintViolationExceptionConverter
com.totvs.tjf.api.response.error.converter.ErrorTransactionSystemExceptionConverter
public class ErrorTransactionSystemExceptionConverter
extends ErrorConstraintViolationExceptionConverter
TransactionSystemException and ApiError converter to
ApiErrorResponse.- Author:
- Rubens dos Santos Filho
-
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.ErrorConstraintViolationExceptionConverter
CONSTRAINT_VIOLATION_NULL_ERROR_MESSAGEFields inherited from class com.totvs.tjf.api.response.error.converter.ErrorExceptionConverter
API_ERROR_NULL_ERROR_MESSAGE, EXCEPTION_NULL_ERROR_MESSAGE -
Constructor Summary
ConstructorsConstructorDescriptionErrorTransactionSystemExceptionConverter(com.totvs.tjf.core.i18n.I18nService i18nService) -
Method Summary
Modifier and TypeMethodDescriptionconvert(javax.validation.ConstraintViolation<?> violation) Converts the givenConstraintViolationto anErrorExceptionConverter.ExceptionErrorMapcontaining theHttpStatusand theApiErrorResponsewith: HttpStatus:BAD_REQUEST; ApiErrorMessage: Code: asConstraintViolation.getMessageTemplate(); Message: an already localized and interpolated message provided byConstraintViolation.getMessage(); and Detailed message: a concatenation with the violated property name and the invalid value.convertAsGeneric(Exception exception) Converts the givenExceptionto anErrorExceptionConverter.ExceptionErrorMapcontaining theHttpStatusand theApiErrorResponsewith: HttpStatus:INTERNAL_SERVER_ERROR; ApiErrorMessage: Code:exception.getClass().getSimpleName(); Message:exception.getLocalizedMessage(); and Detailed message:exception.getCause().getLocalizedMessage(), if a cause exist.Methods inherited from class com.totvs.tjf.api.response.error.converter.ErrorConstraintViolationExceptionConverter
getViolationCode, getViolationDetailMethods inherited from class com.totvs.tjf.api.response.error.converter.ErrorExceptionConverter
convert, convertAsError, convertAsError
-
Constructor Details
-
ErrorTransactionSystemExceptionConverter
public ErrorTransactionSystemExceptionConverter(com.totvs.tjf.core.i18n.I18nService i18nService)
-
-
Method Details
-
convert
public ErrorExceptionConverter.ExceptionErrorMap convert(javax.validation.ConstraintViolation<?> violation) Description copied from class:ErrorConstraintViolationExceptionConverterConverts the givenConstraintViolationto anErrorExceptionConverter.ExceptionErrorMapcontaining theHttpStatusand theApiErrorResponsewith:- HttpStatus:
BAD_REQUEST; - ApiErrorMessage:
- Code: as
ConstraintViolation.getMessageTemplate(); - Message: an already localized and interpolated message provided by
ConstraintViolation.getMessage(); and - Detailed message: a concatenation with the violated property name and the invalid value.
- Code: as
- Overrides:
convertin classErrorConstraintViolationExceptionConverter- Parameters:
violation- violation to be converted- Returns:
- instance of
ErrorExceptionConverter.ExceptionErrorMap - See Also:
- HttpStatus:
-
convertAsGeneric
Description copied from class:ErrorExceptionConverterConverts the givenExceptionto anErrorExceptionConverter.ExceptionErrorMapcontaining theHttpStatusand theApiErrorResponsewith:- HttpStatus:
INTERNAL_SERVER_ERROR; - ApiErrorMessage:
- Code:
exception.getClass().getSimpleName(); - Message:
exception.getLocalizedMessage(); and - Detailed message:
exception.getCause().getLocalizedMessage(), if a cause exist.
- Code:
- Overrides:
convertAsGenericin classErrorConstraintViolationExceptionConverter- Parameters:
exception- generic exception to be converted- Returns:
- instance of
ErrorExceptionConverter.ExceptionErrorMap
- HttpStatus:
-