levee icon indicating copy to clipboard operation
levee copied to clipboard

feat: made isFailure work for timeout errors

Open lucaschen opened this issue 5 years ago • 0 comments

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

lucaschen avatar Aug 30 '20 08:08 lucaschen