Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/active_utils/network_connection_retries.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ module NetworkConnectionRetries
SocketError => "The connection to the remote server could not be established",
OpenSSL::SSL::SSLError => "The SSL connection to the remote server could not be established",
Errno::EHOSTUNREACH => "The remote server could not be reached",
Errno::EADDRNOTAVAIL => "The remote server address is not available"
Errno::EADDRNOTAVAIL => "The remote server address is not available",
Errno::ENETUNREACH => "The destination network is unreachable"
}

DEFAULT_RETRY_ERRORS = {
Expand Down
9 changes: 9 additions & 0 deletions test/unit/network_connection_retries_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,15 @@ def test_eaddrnotavail_raises_correctly
assert_equal "The remote server address is not available", raised.message
end

def test_enetunreach_raises_correctly
raised = assert_raises(ActiveUtils::ConnectionError) do
retry_exceptions do
raise Errno::ENETUNREACH
end
end
assert_equal "The destination network is unreachable", raised.message
end

def test_timeout_errors_raise_correctly
exceptions = [Timeout::Error, Errno::ETIMEDOUT]
if RUBY_VERSION >= '2.0.0'
Expand Down
Loading