When we first introduced Feign into Mocca, we made a strategic decision to not expose Feign in Mocca API. However, currently, everytime an exception is thrown during a Mocca client call, that exception is being wrapped in Feign feign.codec.EncodeException, and that is bad, and the application is not supposed to have Feign on its classpath.
The same problem happens with feign.codec.DecodeException.
Mocca should unwrap user facing exceptions from Feign exceptions and hide Feign exceptions from callers.
Currently MoccaException and javax.validation.ConstraintViolationException are wrapped in Feign feign.codec.EncodeException, but they shouldn't.
As part of this issue, also it has to be made sure all references to feign.codec.EncodeException in Mocca end user documentation are removed.
Dealing with HTTP status code specific Feign exceptions
In addition to feign.codec.EncodeException and javax.validation.ConstraintViolationException, there are other Feign specific exception types that also need to be hidden from Mocca user. All of them should be covered as part of this issue. One example is a set of a dozen or more Feign annotations specific to each 4xx or 5xx HTTP status code. Mocca should provide one or two Mocca specific exception tap to wrap these Feign annotations (instead of having one Mocca exception for each of those Feign exceptions). The Mocca excetion should then expose the HTTP status code. The HTTP method though shouldn't be in the Mocca exception because that will always be POST.
Dealing with Feign EncodeException
When we first introduced Feign into Mocca, we made a strategic decision to not expose Feign in Mocca API. However, currently, everytime an exception is thrown during a Mocca client call, that exception is being wrapped in Feign
feign.codec.EncodeException
, and that is bad, and the application is not supposed to have Feign on its classpath.The same problem happens with
feign.codec.DecodeException
.Mocca should unwrap user facing exceptions from Feign exceptions and hide Feign exceptions from callers. Currently
MoccaException
andjavax.validation.ConstraintViolationException
are wrapped in Feignfeign.codec.EncodeException
, but they shouldn't.As part of this issue, also it has to be made sure all references to
feign.codec.EncodeException
in Mocca end user documentation are removed.Dealing with HTTP status code specific Feign exceptions
In addition to
feign.codec.EncodeException
andjavax.validation.ConstraintViolationException
, there are other Feign specific exception types that also need to be hidden from Mocca user. All of them should be covered as part of this issue. One example is a set of a dozen or more Feign annotations specific to each 4xx or 5xx HTTP status code. Mocca should provide one or two Mocca specific exception tap to wrap these Feign annotations (instead of having one Mocca exception for each of those Feign exceptions). The Mocca excetion should then expose the HTTP status code. The HTTP method though shouldn't be in the Mocca exception because that will always be POST.