Skip to content

Commit 58e0c11

Browse files
committed
Merge pull request #463 from reist/ehostunreach
Add Errno::EHOSTUNREACH to possible CannotConnectError failures
2 parents f02b7ad + b70aecb commit 58e0c11

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/redis/client.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,8 @@ def establish_connection
319319
raise CannotConnectError, "Timed out connecting to Redis on #{location}"
320320
rescue Errno::ECONNREFUSED
321321
raise CannotConnectError, "Error connecting to Redis on #{location} (ECONNREFUSED)"
322+
rescue Errno::EHOSTUNREACH
323+
raise CannotConnectError, "Error connecting to Redis on #{location} (EHOSTUNREACH)"
322324
end
323325

324326
def ensure_connected

0 commit comments

Comments
 (0)