active_utils 3.3.12 → 3.3.13

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 61e472217a759cb93bc5ee87e5c495f557f680a4
4
- data.tar.gz: 065567242b3d417094e9fc0e40dfd491b5a9fa32
3
+ metadata.gz: 2419f33b62bb5ac91f29b58e341436e5fd8d636a
4
+ data.tar.gz: '09d2b0dd502873b3250358165a4d7e05e83174ef'
5
5
  SHA512:
6
- metadata.gz: 0efa9a4885434ffd36ee75a2de7251848da6517425237ae8371dcb4cc5821b26e517655cff675b85bddd95431e6cd6360ad02a62397c9997a4aa7b1c68d24f5d
7
- data.tar.gz: c37cc962951edfde8e72c4a855a1dc41105d78685695f1947996fc57fd95eba7ec81fd8a7e4d4d6011cb9e348b90bb737d8abb2567b07556a2af24ca9963a3e4
6
+ metadata.gz: 8d891d8cf21711ea9d1f303a96e01ada3e15c05f24916f0c2ea18c1cfed27ff268dede6f1e31cc144640353e6d32896af7c33a2dfcbc9afedb000b72b19e813e
7
+ data.tar.gz: 9f332193f661283e2e50b3b38d32e70fe4ddf1c32c31d7a1e0f6d1d4f9f3cf15a82cd8a71361a8c38ffdbfe815f3f2cb390214f7e24e8786f168c65e18549710
@@ -0,0 +1,2 @@
1
+ enabled:
2
+ - cla
@@ -1,5 +1,17 @@
1
1
  # ActiveUtils changelog
2
2
 
3
+ ### Version 3.3.13 (November 26, 2018)
4
+ - Add support for custom retriable exceptions in `NetworkConnectionRetries#retry_exceptions`
5
+
6
+ ### Version 3.3.12 (July 11, 2018)
7
+ - Update CA bundle
8
+
9
+ ### Version 3.3.11 (March 14, 2018)
10
+ - Add the DigiCert Global Root G2 to the CA bundle
11
+
12
+ ### Version 3.3.10 (February 28, 2018)
13
+ - Support ActiveSupport 5.2
14
+
3
15
  ### Version 3.3.9 (September 28, 2017)
4
16
  - Add remaining currencies to `ActiveUtils::CurrencyCode::ISO_CURRENCIES`
5
17
  - Update bundler in `travis.yml`
@@ -10,18 +10,23 @@ module ActiveUtils
10
10
  OpenSSL::SSL::SSLError => "The SSL connection to the remote server could not be established"
11
11
  }
12
12
 
13
+ DEFAULT_RETRY_ERRORS = {
14
+ Errno::ECONNREFUSED => "The remote server refused the connection"
15
+ }
16
+
13
17
  def self.included(base)
14
18
  base.send(:attr_accessor, :retry_safe)
15
19
  end
16
20
 
17
21
  def retry_exceptions(options={})
18
22
  connection_errors = DEFAULT_CONNECTION_ERRORS.merge(options[:connection_exceptions] || {})
23
+ retry_errors = DEFAULT_RETRY_ERRORS.merge(options[:retriable_exceptions] || {})
19
24
 
20
25
  retry_network_exceptions(options) do
21
26
  begin
22
27
  yield
23
- rescue Errno::ECONNREFUSED => e
24
- raise ActiveUtils::RetriableConnectionError, "The remote server refused the connection"
28
+ rescue *retry_errors.keys => e
29
+ raise ActiveUtils::RetriableConnectionError, derived_error_message(retry_errors, e.class)
25
30
  rescue OpenSSL::X509::CertificateError => e
26
31
  NetworkConnectionRetries.log(options[:logger], :error, e.message, options[:tag])
27
32
  raise ActiveUtils::ClientCertificateError, "The remote server did not accept the provided SSL certificate"
@@ -1,3 +1,3 @@
1
1
  module ActiveUtils
2
- VERSION = "3.3.12"
2
+ VERSION = "3.3.13"
3
3
  end
@@ -207,4 +207,12 @@ class NetworkConnectionRetriesTest < Minitest::Test
207
207
  end
208
208
  end
209
209
  end
210
+
211
+ def test_retries_with_custom_error_specified
212
+ @requester.expects(:post).times(2).raises(Errno::ETIMEDOUT).then.returns(@ok)
213
+
214
+ retry_exceptions retriable_exceptions: { Errno::ETIMEDOUT => "The connection to the remote server timed out"} do
215
+ @requester.post
216
+ end
217
+ end
210
218
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.12
4
+ version: 3.3.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shopify
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-07-11 00:00:00.000000000 Z
11
+ date: 2018-11-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -93,6 +93,7 @@ executables: []
93
93
  extensions: []
94
94
  extra_rdoc_files: []
95
95
  files:
96
+ - ".github/probots.yml"
96
97
  - ".gitignore"
97
98
  - ".travis.yml"
98
99
  - CHANGELOG.md