Package org.bremersee.exception.feign
Class FeignClientException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- feign.FeignException
-
- org.bremersee.exception.feign.FeignClientException
-
- All Implemented Interfaces:
Serializable,ErrorCodeAware,HttpResponseHeadersAware,HttpStatusAware,RestApiExceptionAware
public class FeignClientException extends feign.FeignException implements HttpStatusAware, HttpResponseHeadersAware, RestApiExceptionAware, ErrorCodeAware
Feign exception that stores the error payload as aRestApiException. If the error payload cannot be parsed asRestApiException, the whole body of the error payload will be stored in the message field of theRestApiException.- Author:
- Christian Bremer
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class feign.FeignException
feign.FeignException.BadGateway, feign.FeignException.BadRequest, feign.FeignException.Conflict, feign.FeignException.FeignClientException, feign.FeignException.FeignServerException, feign.FeignException.Forbidden, feign.FeignException.GatewayTimeout, feign.FeignException.Gone, feign.FeignException.InternalServerError, feign.FeignException.MethodNotAllowed, feign.FeignException.NotAcceptable, feign.FeignException.NotFound, feign.FeignException.NotImplemented, feign.FeignException.ServiceUnavailable, feign.FeignException.TooManyRequests, feign.FeignException.Unauthorized, feign.FeignException.UnprocessableEntity, feign.FeignException.UnsupportedMediaType
-
-
Field Summary
-
Fields inherited from interface org.bremersee.exception.ErrorCodeAware
NO_ERROR_CODE_VALUE
-
-
Constructor Summary
Constructors Constructor Description FeignClientException(feign.Request request, Map<String,? extends Collection<String>> headers, int status, String message, org.bremersee.exception.model.RestApiException restApiException)Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetErrorCode()Gets the error code.Map<String,? extends Collection<String>>getMultiValueHeaders()Gets the response headers as multi value map.-
Methods inherited from class feign.FeignException
content, contentUTF8, errorStatus, hasRequest, request, responseBody, status
-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.bremersee.exception.HttpStatusAware
status
-
Methods inherited from interface org.bremersee.exception.RestApiExceptionAware
getRestApiException
-
-
-
-
Constructor Detail
-
FeignClientException
public FeignClientException(@Nullable feign.Request request, @Nullable Map<String,? extends Collection<String>> headers, int status, @Nullable String message, @Nullable org.bremersee.exception.model.RestApiException restApiException)Default constructor.- Parameters:
request- the original requestheaders- the response headersstatus- the response status codemessage- the message of thisFeignException.FeignClientExceptionrestApiException- the rest api exception
-
-
Method Detail
-
getMultiValueHeaders
public Map<String,? extends Collection<String>> getMultiValueHeaders()
Description copied from interface:HttpResponseHeadersAwareGets the response headers as multi value map.- Specified by:
getMultiValueHeadersin interfaceHttpResponseHeadersAware- Returns:
- the response headers
-
getErrorCode
public String getErrorCode()
Description copied from interface:ErrorCodeAwareGets the error code.- Specified by:
getErrorCodein interfaceErrorCodeAware- Returns:
- the error code
-
-