Add ability to not throw exception when http status code > 399
Currently our team convention is to use response status instead of throwing exception. Say our model is like this:
public class BaseResponse {
private String message;
private int httpStatusCode;
private Boolean isFailed;
private int errorCode;
}
So when our API endpoint failed, we return BaseResponse with failed status instead. Now this is not possible to be read by the client using openfeign since feign will throw exception directly if >399 response status retrieved, so our returned response is useless. We can make our api to return 200 status code instead, but that would violate RESTFUL.
Understand that openfeign is designed to be strictly RESTFUL, but I don't think forcing your user to throw exception is the right thing, because different teams have different convention used on how they handle the failure, and in our case we use our response entity that would describe the failure status.
I appreciate if this feature can be considered, and I will be happy to contribute if needed. Thank you.
I wonder how is this feature not implemented in feign in 21-st century year 2025?
Why is there no easy way of configuring openfeign to NOT THROW EXCEPTION if status code > 399?
I get it, there is a way of writing a custom error decoder, and there is a way of manually parsing the response using my own choice of object mappers or other mappers like gson, but that is not what we want.
Why is openfeign so bad? Nevermind, don't answer this question, my previous two questions are better for coming up with productive answer.