levee
levee copied to clipboard
feat: made isFailure work for timeout errors
Previously, timeout errors would always count as a failure and trigger the circuit breaker.
This is problematic when certain APIs are expected to (sometimes) time out.
Yes, this is bad design. No, there's not that much that can be done when it's an external API.
I have added support for timeout errors to be included in isFailure, and added a basic test to support this. Please feel free to make suggestions / changes as required! Thanks 😄
Relevant issue: https://github.com/krakenjs/levee/issues/30