diff --git a/spring-cloud-openfeign-core/src/main/java/org/springframework/cloud/openfeign/support/SortJsonComponent.java b/spring-cloud-openfeign-core/src/main/java/org/springframework/cloud/openfeign/support/SortJsonComponent.java index a09d3442..60861127 100644 --- a/spring-cloud-openfeign-core/src/main/java/org/springframework/cloud/openfeign/support/SortJsonComponent.java +++ b/spring-cloud-openfeign-core/src/main/java/org/springframework/cloud/openfeign/support/SortJsonComponent.java @@ -29,9 +29,8 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.JsonSerializer; import com.fasterxml.jackson.databind.SerializerProvider; import com.fasterxml.jackson.databind.node.ArrayNode; +import feign.codec.EncodeException; -import org.springframework.core.convert.ConversionFailedException; -import org.springframework.core.convert.TypeDescriptor; import org.springframework.data.domain.Sort; /** @@ -52,9 +51,7 @@ public class SortJsonComponent { gen.writeObject(v); } catch (IOException e) { - throw new ConversionFailedException( - TypeDescriptor.valueOf(Sort.class), - TypeDescriptor.valueOf(String.class), v, e); + throw new EncodeException("Couldn't serialize object " + v); } }); gen.writeEndArray();