Skip to content

Commit 7c9a7e6

Browse files
catch NotImplementedError for older Ruby
1 parent 87498d9 commit 7c9a7e6

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/stripe/stripe_configuration.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,12 @@ def self.client_init(config_opts)
4545
imported_options = USER_CONFIGURABLE_GLOBAL_OPTIONS - StripeClient::CLIENT_OPTIONS
4646
client_config = StripeConfiguration.setup do |instance|
4747
imported_options.each do |key|
48-
instance.public_send("#{key}=", global_config.public_send(key)) if global_config.respond_to?(key)
48+
begin
49+
instance.public_send("#{key}=", global_config.public_send(key)) if global_config.respond_to?(key)
50+
rescue NotImplementedError => e
51+
# In Ruby <= 2.5, we can't set write_timeout on Net::HTTP, log an error and continue
52+
Util.log_error("Failed to set #{key} on client configuration: #{e}")
53+
end
4954
end
5055
end
5156
client_config.reverse_duplicate_merge(config_opts)

0 commit comments

Comments
 (0)