Class ApiExceptionHandler
java.lang.Object
com.totvs.tjf.api.response.error.handler.ApiExceptionHandler
@Order(2147483647)
@ControllerAdvice(annotations=com.totvs.tjf.api.context.stereotype.ApiGuideline.class)
public final class ApiExceptionHandler
extends Object
Exception interceptors to adjusts its contents as
ApiErrorResponse according to TOTVS API Guideline. Note: This advice has
Ordered.LOWEST_PRECEDENCE- Author:
- Thiago A. de Souza Weber
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<com.totvs.tjf.api.context.response.ApiErrorResponse>Generic handler for exceptions to adjust it's content toApiErrorResponseto be serialized according to the TOTVS API Guideline.
-
Constructor Details
-
ApiExceptionHandler
-
-
Method Details
-
handler
@ExceptionHandler(java.lang.Exception.class) public org.springframework.http.ResponseEntity<com.totvs.tjf.api.context.response.ApiErrorResponse> handler(Exception exception, org.springframework.web.method.HandlerMethod handlerMethod) Generic handler for exceptions to adjust it's content toApiErrorResponseto be serialized according to the TOTVS API Guideline.When the exception dont't have an
ApiErrorits content is gone be considered a generic error withINTERNAL_SERVER_ERROR.- Parameters:
exception- to be handled- Returns:
- an
ApiErrorResponseto be serialized - See Also:
-
ExceptionHandlerErrorExceptionConverter.convert(Exception)
-