Closed samuel-henry closed 2 years ago
Hi @samuel-henry,
Where are you seeing a retry_limit
parameter? I don't believe this is a supported client option by default, and you will likely need to define and pass a custom HTTP client that has your desired retry limit configured.
Hi Elise,
Thank you for taking a look at this
I saw it on https://www.rubydoc.info/gems/twilio-ruby/3.10.1/Twilio/REST/Client
We see that it's set to 1 by default:
API_VERSION = '2010-04-01' HTTP_HEADERS = { 'Accept' => 'application/json', 'Accept-Charset' => 'utf-8', 'User-Agent' => "twilio-ruby/#{Twilio::VERSION}", } DEFAULTS = { :host => 'api.twilio.com', :port => 443, :use_ssl => true, :ssl_verify_peer => true, :ssl_ca_file => File.dirname(__FILE__) + '/../../../conf/cacert.pem', :timeout => 30, :proxy_addr => nil, :proxy_port => nil, :proxy_user => nil, :proxy_pass => nil, :retry_limit => 1, }
But that you can pass in an option to override the default (https://www.rubydoc.info/gems/twilio-ruby/3.10.1/Twilio/REST/Client#initialize-instance_method):
:retry_limit => 1
"The number of times to retry a request that has failed before throwing an exception. Defaults to one."
Thank you for the link regarding a custom HTTP client
Thank you, Sam
Hi Elise,
Just checking back on this.
Thank you! Sam
Hi Sam,
The documentation you linked is for twilio-ruby version 3.10.1
, whereas you stated you are using 5.48.0
. If you look at the documentation for version 5.48.0 you'll see the initialization function does not accept a options object as the third argument, but rather an optional account SID. This is why the object you're passing ({:retry_limit=>3}
) is being substituted for the account_sid
(instead of the value you passed as the username
parameter) in the URI the client builds.
twilio-ruby version 3.10.1
is no longer being actively supported.
You will need to define a custom HTTP client with a specified retry limit and pass it into the Client initializer. Please reference this documentation for guidance on how to implement a custom HTTP client and pass it to the Twilio Client initializer.
Ah, thank you Elise
I'll close this out but can you please pass along the feature request or +1 the existing backlog item to re-add this option to make it simple to configure retry strategy without having to define a custom client?
Thank you Sam
Issue Summary
Getting an error trying to send an SMS with a client configured with more than the default # of retries
Steps to Reproduce
Code Snippet
Exception/Log
Technical details: