diff --git a/lib/active_utils/network_connection_retries.rb b/lib/active_utils/network_connection_retries.rb index 2bc4633..b610f7c 100644 --- a/lib/active_utils/network_connection_retries.rb +++ b/lib/active_utils/network_connection_retries.rb @@ -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 = { diff --git a/test/unit/network_connection_retries_test.rb b/test/unit/network_connection_retries_test.rb index 9d09bb3..0c7b475 100644 --- a/test/unit/network_connection_retries_test.rb +++ b/test/unit/network_connection_retries_test.rb @@ -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'