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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dd0753dcb7f0a1ee3c16fb466e38634f8b24e4ad
|
4
|
+
data.tar.gz: b35ab554e22841ad7471514da0f8b8c2dd33b4bd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
|
@@ -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(
|
9
|
+
parent_exception = AeNetworkConnectionException::ConnectionNotEstablished.new('Parent Message')
|
10
10
|
|
11
11
|
assert_equal nil, parent_exception.cause
|
12
|
-
assert_equal
|
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(
|
17
|
+
raise StandardError.new('New Child Message')
|
18
18
|
rescue => e
|
19
19
|
child_exception = e
|
20
|
-
parent_exception = AeNetworkConnectionException::ConnectionNotEstablished.new(
|
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
|
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.
|
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-
|
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.
|
79
|
+
rubygems_version: 2.4.8
|
80
80
|
signing_key:
|
81
81
|
specification_version: 4
|
82
82
|
summary: Provides sane exceptions for network failures
|