Open ccwurtz opened 1 year ago
Hi @ccwurtz, Thank you for the heads up! We have added this enhancement request to our backlog. Pull requests and +1s on the issue will help it move up the backlog. It would be great if you can submit a PR implementing this
Thanks, Athira
Scope creeping here: But having the ability to choose which error codes should be retried would help. As multiple people have reported in this repository over time, Twilio's API sometimes throws a 404 for a valid request and I'd like to see these retried automatically.
Description
Currently, if configured the twilio-node library automatically retries requests when it encounters a 429 error, but there's no way to be notified or modify this behavior.
Proposal
Add an optional onRetry parameter to the twilio() function that accepts a callback to be called whenever a 429 error is encountered. This would allow users to handle or log these errors in a custom way.
Example usage:
I'd be happy to submit a PR to implement this.