smartcar / retryify

Wrap a function to retry on specific errors.
MIT License
11 stars 1 forks source link

feat: replace `.errors` with `.shouldRetry` #60

Closed gurpreetatwal closed 4 years ago

gurpreetatwal commented 4 years ago

options.errors replaced with options.shouldRetry instead

shouldRetry is more flexible than .errors as it allows the user to retry based on basically any property of the caught error.

User facing change:

-  errors: A,
+  shouldRetry: (caught) => caught instanceof A),
-  errors: [A, B, C],
+  shouldRetry: (caught) => [A, B, C].some(Candidate => caught instanceof Candidate),
codecov[bot] commented 4 years ago

Codecov Report

Merging #60 into master will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master       #60   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            2         2           
  Lines           49        43    -6     
=========================================
- Hits            49        43    -6     
Impacted Files Coverage Δ
index.js 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 87d3989...d01578a. Read the comment docs.

smartcar-ci commented 4 years ago

:tada: This PR is included in version 5.0.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: