Treat bad requests separately from other errors
epivovar opened this issue · 0 comments
epivovar commented
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:
- Make a channel
badRequests
before engaginghystrix.Go
- Inside the user-defined hystrix command, route appropriate errors to
badRequests
instead of returning them - After command execution, handle errors from
badRequests
in addition to those returned byhystrix.Go
Proposal:
- Create an interface
badRequest
in hystrix - Add an exported method to be used inside hystrix commands that converts an
error
to a type that implements botherror
andbadRequest
interfaces so that the commands will return it instead of the original error badRequest
errors neither count against the failure metrics nor trigger fallback logic- After
hystrix.Go
execution, user's code can pull all errors from the same channel and if necessary, can treatbadRequest
errors separately