Closed fabriciomsdev closed 12 months ago
Very interesting, thanks a lot for your contribution. There's a couple of things to change in the PR though:
We've just migrated the implementation of this library to typescript Please review my comments and create a new PR if you think this is still relevant Thank you!
Why:
Sometimes we need to treat retry error in HTTP communications as a step of big flow we should follow, for example to classify a http transaction to be retried again by another service in the background.
Solution:
For this reason I am creating the callback onMaxRetryTimesExceeded to be called after the last retry was called. That way we can trigger for example a custom Exception to classify the transaction.
Example of Use: