NoRedInk / rspec-retry

retry randomly failing rspec example
MIT License
581 stars 95 forks source link

Proposal: more flexible API by allowing configuration on indivudual errors #99

Open ianks opened 5 years ago

ianks commented 5 years ago

The current configuration API is nice, but it has one major shortcoming: specific errors can't specify different retry behavior. This is often desirable since certain errors have different requirements. Here is some pseudo-code to show what I mean:

example.run_with_retry retrriables:[
  { exception: Capybara::ElementNotFound, retry_wait: 0, retry: 3 },
  { exception: RateLimitError, retry_wait: 30, retry: 1 }
]

This type of configuration would make dealing with errors much more robust IMO. Anywho, love the gem and just figured I would give some feedback :smile:

Cheers, Ian