question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Annotation based error-decoder

See original GitHub issue

Hello - 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:closed
  • Created 7 years ago
  • Reactions:4
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
spencergibbcommented, Dec 14, 2016

@arielsegura please use the “Add your reaction” widget rather than a comment.

0reactions
saintfcommented, Mar 1, 2019

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

OpenFeign/feign-annotation-error-decoder - GitHub
This module allows to annotate Feign's interfaces with annotations to generate Exceptions based on error codes. To use AnnotationErrorDecoder with Feign, ...
Read more >
Retrieve Original Message From Feign ErrorDecoder - Baeldung
Learn to retrieve the original message from Feign ErrorDecoder. ... In addition, to Feign annotations, it also supports JAX-RS, ...
Read more >
Feign Error Handling with ErrorDecoder - Apps Developer Blog
In this tutorial, I will share with you how you can use Feign ErrorDecoder to handle errors that occur when using Feign client...
Read more >
netflix feign - How to make customized ErrorDecoder and ...
I have a spring cloud service called "hr", and a api gateway service using Feign as client to call the hr service. If...
Read more >
Error Decoding and Retrying with Feign Clients
In this post I'm not going to talk about the annotations because ... You can use error-decoder to act based on the erroneous...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found