wsargent / circuit_breaker

Implementation of Michael Nygard's Circuit Breaker pattern in Ruby
http://rdoc.info/projects/wsargent/circuit_breaker
404 stars 37 forks source link

Not consider some Exceptions as failure #3

Closed wandenberg closed 11 years ago

wandenberg commented 12 years ago

Hi,

I'm trying to use your gem but had a need to not consider some Exceptions as failure, i.e. using ActiveRecord to load a resource I can receive a 404 ResourceNotFoundException which isn't a failure, and shouldn't count as one.

I maked a change in your gem to be possible to pass an array with the exceptions which should not count as failures for circuit breaker.

I hope you can apply this to your gem.

Regards, Wandenberg

rud commented 11 years ago

This looks like a valuable additional functionality. Any tests or docs missing before it can be included?

wsargent commented 11 years ago

Thanks. Merged in and pushed as 1.1.0.