Package org.bremersee.exception.feign
Class FeignClientExceptionErrorDecoder
java.lang.Object
org.bremersee.exception.feign.FeignClientExceptionErrorDecoder
- All Implemented Interfaces:
feign.codec.ErrorDecoder
This error decoder produces either a
FeignClientException
or a
RetryableException
.- Author:
- Christian Bremer
-
Nested Class Summary
Nested classes/interfaces inherited from interface feign.codec.ErrorDecoder
feign.codec.ErrorDecoder.Default, feign.codec.ErrorDecoder.RetryAfterDecoder
-
Constructor Summary
ConstructorDescriptionInstantiates a new feign client exception error decoder.Instantiates a new feign client exception error decoder. -
Method Summary
Modifier and TypeMethodDescriptionprotected long
Returns the current time millis of the system.determineRetryAfter
(String retryAfter) Determine retry after.protected feign.Request.HttpMethod
getHttpMethod
(feign.Response response) Find http method.protected byte[]
getResponseBody
(feign.Response response) Get response body.
-
Constructor Details
-
FeignClientExceptionErrorDecoder
public FeignClientExceptionErrorDecoder()Instantiates a new feign client exception error decoder. -
FeignClientExceptionErrorDecoder
Instantiates a new feign client exception error decoder.- Parameters:
parser
- the parser
-
-
Method Details
-
decode
- Specified by:
decode
in interfacefeign.codec.ErrorDecoder
-
getResponseBody
protected byte[] getResponseBody(feign.Response response) Get response body.- Parameters:
response
- the response- Returns:
- the body as byte array
-
getHttpMethod
protected feign.Request.HttpMethod getHttpMethod(feign.Response response) Find http method.- Parameters:
response
- the response- Returns:
- the http method
-
determineRetryAfter
Determine retry after.- Parameters:
retryAfter
- the retry after- Returns:
- the optional
-
currentTimeMillis
protected long currentTimeMillis()Returns the current time millis of the system.- Returns:
- the current time millis of the system
-