Class TransferRestErrorHandler

java.lang.Object
es.kukenan.smartfi.microservice.transfer.service.backoffice.TransferRestErrorHandler
All Implemented Interfaces:
org.springframework.web.client.ResponseErrorHandler
Direct Known Subclasses:
CoreRestErrorHandler

public class TransferRestErrorHandler extends Object implements org.springframework.web.client.ResponseErrorHandler
Move money rest error handler.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected String
    extractErrorResponse(org.springframework.http.client.ClientHttpResponse response)
    Try to create a string from the error response with the only purpose to be logged.
    void
    handleError(org.springframework.http.client.ClientHttpResponse response)
    Handle a product error response, that is, throw the proper kukenanException.
    boolean
    hasError(org.springframework.http.client.ClientHttpResponse response)
     
    protected void
    throwBadRequestSpecificException(String errorMsg, String errorResponseBody)
    Throws the specific bad request exception from the error response.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.springframework.web.client.ResponseErrorHandler

    handleError
  • Constructor Details

    • TransferRestErrorHandler

      public TransferRestErrorHandler()
  • Method Details

    • hasError

      public boolean hasError(org.springframework.http.client.ClientHttpResponse response) throws IOException
      Specified by:
      hasError in interface org.springframework.web.client.ResponseErrorHandler
      Throws:
      IOException
    • handleError

      public void handleError(org.springframework.http.client.ClientHttpResponse response)
      Handle a product error response, that is, throw the proper kukenanException.
      Specified by:
      handleError in interface org.springframework.web.client.ResponseErrorHandler
      Parameters:
      response - error response.
    • throwBadRequestSpecificException

      protected void throwBadRequestSpecificException(String errorMsg, String errorResponseBody)
      Throws the specific bad request exception from the error response.
      Parameters:
      errorMsg - error message.
      errorResponseBody - error response body.
    • extractErrorResponse

      protected String extractErrorResponse(org.springframework.http.client.ClientHttpResponse response)
      Try to create a string from the error response with the only purpose to be logged.
      Parameters:
      response - ClientHttpResponse.
      Returns:
      a string from the error response.