Skip to content

Commit

Permalink
catch NotImplementedError for older Ruby
Browse files Browse the repository at this point in the history
  • Loading branch information
helenye-stripe committed Jan 13, 2025
1 parent 6c2f861 commit 68db5c4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/stripe/stripe_configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,12 @@ def self.client_init(config_opts)
imported_options = USER_CONFIGURABLE_GLOBAL_OPTIONS - StripeClient::CLIENT_OPTIONS
client_config = StripeConfiguration.setup do |instance|
imported_options.each do |key|
instance.public_send("#{key}=", global_config.public_send(key)) if global_config.respond_to?(key)
begin
instance.public_send("#{key}=", global_config.public_send(key)) if global_config.respond_to?(key)
rescue NotImplementedError => e
# In Ruby <= 2.5, we can't set write_timeout on Net::HTTP, log an error and continue
Util.log_error("Failed to set #{key} on client configuration: #{e}")
end
end
end
client_config.reverse_duplicate_merge(config_opts)
Expand Down

0 comments on commit 68db5c4

Please sign in to comment.