awolden / brakes

Hystrix compliant Node.js Circuit Breaker Library
MIT License
300 stars 35 forks source link

Add isSuccess option? #93

Closed ivarconr closed 5 years ago

ivarconr commented 6 years ago

When using fetch to do remote http calls we will get a promise back. If the service response is a 5xx satus this is still considered a "resolving" promise. When this happens i would brakes to consider this as a failure. Today this means I have convert the resolving promise in to a rejecting one, which feels a bit awkward.

If there where an isSuccess option I could easily verify that the response code is not in the 500-range.