Class SmartfiCoreExceptionHandler

java.lang.Object
org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler
es.kukenan.smartfi.springboot.controller.RestExceptionHandler
es.kukenan.smartfi.microservice.smartficore.exception.SmartfiCoreExceptionHandler

@ControllerAdvice public class SmartfiCoreExceptionHandler extends es.kukenan.smartfi.springboot.controller.RestExceptionHandler
Exception handler to format Smartfi Core response.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private es.kukenan.smartfi.microservice.backoffice.dtos.core.response.CoreResponse<List<Object>>
    Response body for the exception.
    private String
    List of endpoint not to be filtered.
    private String
    List of transfers endpoint not to be filtered.

    Fields inherited from class org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler

    logger, PAGE_NOT_FOUND_LOG_CATEGORY, pageNotFoundLogger
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.springframework.http.ResponseEntity<Object>
    handleCoreException(SmartfiCoreException ex, org.springframework.web.context.request.WebRequest request)
    Handler to SmartfiCoreException.
    private org.springframework.http.ResponseEntity<Object>
    handleCoreExceptionInternal(Exception ex, Object body, org.springframework.http.HttpHeaders headers, org.springframework.http.HttpStatus status, org.springframework.web.context.request.WebRequest request)
     
    org.springframework.http.ResponseEntity<Object>
    handleServletRequestBindingException(org.springframework.web.bind.ServletRequestBindingException ex, org.springframework.http.HttpHeaders headers, org.springframework.http.HttpStatus status, org.springframework.web.context.request.WebRequest request)
     
    private boolean
    isCoreEndpoint(String path, String pattern)
     

    Methods inherited from class es.kukenan.smartfi.springboot.controller.RestExceptionHandler

    handleAccessDeniedException, handleAuthenticationException, handleExceptionInternal, handleMissingServletRequestParameter, handleRuntimeException, handleUnexpectedException, handleWalletException

    Methods inherited from class org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler

    handleAsyncRequestTimeoutException, handleBindException, handleConversionNotSupported, handleException, handleHttpMediaTypeNotAcceptable, handleHttpMediaTypeNotSupported, handleHttpMessageNotReadable, handleHttpMessageNotWritable, handleHttpRequestMethodNotSupported, handleMethodArgumentNotValid, handleMissingPathVariable, handleMissingServletRequestPart, handleNoHandlerFoundException, handleTypeMismatch

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • patternsCoreEndpoints

      @Value("${patterns.core.endpoints}") private String patternsCoreEndpoints
      List of endpoint not to be filtered.
    • patternsCoreTransfersEndpoints

      @Value("${patterns.core.transfers.endpoints}") private String patternsCoreTransfersEndpoints
      List of transfers endpoint not to be filtered.
    • errorResponse

      private es.kukenan.smartfi.microservice.backoffice.dtos.core.response.CoreResponse<List<Object>> errorResponse
      Response body for the exception.
  • Constructor Details

    • SmartfiCoreExceptionHandler

      public SmartfiCoreExceptionHandler()
  • Method Details

    • handleCoreException

      @ExceptionHandler(SmartfiCoreException.class) public org.springframework.http.ResponseEntity<Object> handleCoreException(SmartfiCoreException ex, org.springframework.web.context.request.WebRequest request)
      Handler to SmartfiCoreException.
      Parameters:
      ex - SmartfiCoreException
      request - Http request
      Returns:
      Http response entity
    • handleServletRequestBindingException

      public org.springframework.http.ResponseEntity<Object> handleServletRequestBindingException(org.springframework.web.bind.ServletRequestBindingException ex, org.springframework.http.HttpHeaders headers, org.springframework.http.HttpStatus status, org.springframework.web.context.request.WebRequest request)
      Overrides:
      handleServletRequestBindingException in class org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler
    • handleCoreExceptionInternal

      private org.springframework.http.ResponseEntity<Object> handleCoreExceptionInternal(Exception ex, Object body, org.springframework.http.HttpHeaders headers, org.springframework.http.HttpStatus status, org.springframework.web.context.request.WebRequest request)
    • isCoreEndpoint

      private boolean isCoreEndpoint(String path, String pattern)