Annotation based error-decoder
See original GitHub issueHello - I looked around a while ago for an annotation based error decoder and couldn’t really find one - so I wanted to see the apetite for one?
If it sounds interesting, I can clone the repo, create a new module under it (thoughts on naming?) and put something good in there for review?
Basically - it would be managed via 2 annotations:
@ErrorDecoding
which would take a few parameters, including a second annotation named something to the effect of @ErrorCodes
(the idea being that multiple error codes could still map to the same annotation).
So basically, in your interface you’d annotate your method (or class) with something like:
@ErrorDecoding { @ErrorCodes { [401, 403], mapTo = UnauthenticatedOrUnauthorizedException.class }}
Then - you’d just pass it into the Feign.Builder via the ErrorDecoder as a new AnnotationBasedErrorDecoder or something to that effect.
Thoughts?
Issue Analytics
- State:
- Created 7 years ago
- Reactions:4
- Comments:6 (3 by maintainers)
@arielsegura please use the “Add your reaction” widget rather than a comment.
Cleaning up left behind ticket. The decoder was developed/added way back when.
Can be found here: https://github.com/OpenFeign/feign-annotation-error-decoder