Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Treat bad requests separately from other errors #72

Open
epivovar opened this issue Aug 23, 2017 · 0 comments
Open

Treat bad requests separately from other errors #72

epivovar opened this issue Aug 23, 2017 · 0 comments

Comments

@epivovar
Copy link

Feature request: Need a separate treatment of errors returned by the hystrix command due to illegal arguments or non-system failures, similar to HystrixBadRequestException in the Java version of hystrix

Workaround:

  1. Make a channel badRequests before engaging hystrix.Go
  2. Inside the user-defined hystrix command, route appropriate errors to badRequests instead of returning them
  3. After command execution, handle errors from badRequests in addition to those returned by hystrix.Go

Proposal:

  1. Create an interface badRequest in hystrix
  2. Add an exported method to be used inside hystrix commands that converts an error to a type that implements both error and badRequest interfaces so that the commands will return it instead of the original error
  3. badRequest errors neither count against the failure metrics nor trigger fallback logic
  4. After hystrix.Go execution, user's code can pull all errors from the same channel and if necessary, can treat badRequest errors separately
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant