ae_network_connection_exception 1.2.0 → 1.3.0

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: 4d15412b0f4f9d37fc5d9f5d9964689fe9ec590f
4
- data.tar.gz: 57dc942fa855395fdee76cdd72116cf070b86fab
3
+ metadata.gz: dd0753dcb7f0a1ee3c16fb466e38634f8b24e4ad
4
+ data.tar.gz: b35ab554e22841ad7471514da0f8b8c2dd33b4bd
5
5
  SHA512:
6
- metadata.gz: dce615eb9c83dfc8f1e8695cd6581bc03d9f4629c90068cc4ad3cc9f31f21c8b778cb570efff2cdc6961c7fef36800cc1a3d5d83c35127754b6b1e0214c510d1
7
- data.tar.gz: 2bc44eb8602db36ce550a6f8dc0b6be056793a65942cbf187e4759b4014a7b62e220d888794e5a26d6e36c1d6c0882557f886605e89a4e59577aea8f3f1d4c17
6
+ metadata.gz: d5b9fd6ee16871e2da071b8488e8b28845de354824de6ea08de51e55c1185e2e5038b2f7b4188d769458ea1a72594ba82a05cfb51d8d3a5efa65c5d56b78f8c1
7
+ data.tar.gz: 4766a393b3f12df852a9154fc8627fc4c81d49f4020fe259be28a0b8cc384612e3f3ac82d7ccedf6b74ab05cee16a884643bc5326cd561c4eca1eabc57723130
@@ -14,7 +14,7 @@ module AeNetworkConnectionException
14
14
  # Net::OpenTimeout happens when we are unable to establish an HTTP connection before the open_timeout
15
15
 
16
16
  raise ConnectionNotEstablished
17
- rescue Errno::ETIMEDOUT, Errno::ECONNREFUSED => e
17
+ rescue Errno::ETIMEDOUT, Errno::ECONNREFUSED, Errno::EHOSTUNREACH, Errno::ENETUNREACH => e
18
18
  # Errno::ECONNREFUSED happens when we can not connect to the port
19
19
  # Errno::ETIMEDOUT happens when we timeout durring the tcp handshake
20
20
  # It is important to note, Errno::ETIMEDOUT can also happen after we have established a connection and are waiting for a response.
@@ -36,7 +36,9 @@ module AeNetworkConnectionException
36
36
  Errno::ECONNREFUSED.new('Connection refused - connect(2) for "example.com" port 443'),
37
37
  Errno::ETIMEDOUT.new('Connection timed out - connect(2) for "example.com" port 443'),
38
38
  Net::OpenTimeout.new('message'),
39
- Errno::ECONNRESET.new('Connection reset by peer - SSL_connect')
39
+ Errno::ECONNRESET.new('Connection reset by peer - SSL_connect', Errno::ECONNREFUSED.new('Connection refused - connect(2) for "example.com" port 443')),
40
+ Errno::EHOSTUNREACH.new('No route to host - connect(2) for "example.com" port 443'),
41
+ Errno::ENETUNREACH.new('Network is unreachable - connect(2) for "example.com" port 443')
40
42
  ]
41
43
  end
42
44
 
@@ -1,3 +1,3 @@
1
1
  module AeNetworkConnectionException
2
- VERSION = "1.2.0"
2
+ VERSION = "1.3.0"
3
3
  end
@@ -6,24 +6,24 @@ module AeNetworkConnectionException
6
6
  # Exception Causes are standard with ruby 2.1
7
7
  # http://devblog.avdi.org/2013/12/25/exception-causes-in-ruby-2-1
8
8
 
9
- parent_exception = AeNetworkConnectionException::ConnectionNotEstablished.new("Parent Message")
9
+ parent_exception = AeNetworkConnectionException::ConnectionNotEstablished.new('Parent Message')
10
10
 
11
11
  assert_equal nil, parent_exception.cause
12
- assert_equal "Parent Message", parent_exception.message
12
+ assert_equal 'Parent Message', parent_exception.message
13
13
 
14
14
  begin
15
15
  child_exception = nil
16
16
  begin
17
- raise StandardError.new("New Child Message")
17
+ raise StandardError.new('New Child Message')
18
18
  rescue => e
19
19
  child_exception = e
20
- parent_exception = AeNetworkConnectionException::ConnectionNotEstablished.new("New Parent Message")
20
+ parent_exception = AeNetworkConnectionException::ConnectionNotEstablished.new('New Parent Message')
21
21
  end
22
22
  rescue AeNetworkConnectionException::ConnectionNotEstablished => parent_exception
23
23
 
24
24
  refute_nil child_exception
25
25
  assert_equal child_exception, parent_exception.cause
26
- assert_equal "New Parent Message, cause => StandardError: New Child Message", parent_exception.message
26
+ assert_equal 'New Parent Message, cause => StandardError: New Child Message', parent_exception.message
27
27
  end
28
28
  end
29
29
 
@@ -52,7 +52,9 @@ module AeNetworkConnectionException
52
52
  Errno::ECONNREFUSED.new('Connection refused - connect(2) for "example.com" port 443'),
53
53
  Errno::ETIMEDOUT.new('Connection timed out - connect(2) for "example.com" port 443'),
54
54
  Net::OpenTimeout.new('message'),
55
- Errno::ECONNRESET.new('Connection reset by peer - SSL_connect')
55
+ Errno::ECONNRESET.new('Connection reset by peer - SSL_connect', Errno::ECONNREFUSED.new('Connection refused - connect(2) for "example.com" port 443')),
56
+ Errno::EHOSTUNREACH.new('No route to host - connect(2) for "example.com" port 443'),
57
+ Errno::ENETUNREACH.new('Network is unreachable - connect(2) for "example.com" port 443')
56
58
  ]
57
59
 
58
60
  assert_equal expected_signatures.size, AeNetworkConnectionException.exception_signatures.size
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ae_network_connection_exception
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steven Boyd
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-10 00:00:00.000000000 Z
11
+ date: 2015-11-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -76,7 +76,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
76
76
  version: '0'
77
77
  requirements: []
78
78
  rubyforge_project:
79
- rubygems_version: 2.4.3
79
+ rubygems_version: 2.4.8
80
80
  signing_key:
81
81
  specification_version: 4
82
82
  summary: Provides sane exceptions for network failures