Package feign.codec

Class ErrorDecoder.Default

    • Constructor Detail

      • Default

        public Default()
    • Method Detail

      • decode

        public java.lang.Exception decode​(java.lang.String methodKey,
                                          Response response)
        Description copied from interface: ErrorDecoder
        Implement this method in order to decode an HTTP Response when Response.status() is not in the 2xx range. Please raise application-specific exceptions where possible. If your exception is retryable, wrap or subclass RetryableException
        Specified by:
        decode in interface ErrorDecoder
        Parameters:
        methodKey - Feign.configKey(java.lang.Class, java.lang.reflect.Method) of the java method that invoked the request. ex. IAM#getUser()
        response - HTTP response where status is greater than or equal to 300.
        Returns:
        Exception IOException, if there was a network error reading the response or an application-specific exception decoded by the implementation. If the throwable is retryable, it should be wrapped, or a subtype of RetryableException