circuitbreaker icon indicating copy to clipboard operation
circuitbreaker copied to clipboard

Store history of last N errors and api to get last error or all history

Open kanekv opened this issue 7 years ago • 3 comments

We want to use circuit breaker instance in our healthcheck reporting. Would be nice if cb instance was able to report which errors triggered it to fail. If that's something you consider useful for this library we can send a PR.

kanekv avatar Apr 11 '17 03:04 kanekv

That sounds cool, I'd definitely take a PR for it. 👍

rubyist avatar Apr 11 '17 03:04 rubyist

so we envision a couple of additional api methods, it will stay compatible: FailWithError(error) Error() error - return last error Errors() []error - return history of errors

I'm not sure yet how we configure history depth. Do you have any suggestions?

kanekv avatar Apr 11 '17 03:04 kanekv

@rubyist I've submitted PR, let me know what you think. Thanks!

kanekv avatar Apr 13 '17 01:04 kanekv