File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -315,12 +315,14 @@ def establish_connection
315
315
@options [ :port ] = server [ :port ]
316
316
317
317
@connection = @options [ :driver ] . connect ( server )
318
- rescue TimeoutError
319
- raise CannotConnectError , "Timed out connecting to Redis on #{ location } "
320
- rescue Errno ::ECONNREFUSED
321
- raise CannotConnectError , "Error connecting to Redis on #{ location } (ECONNREFUSED)"
322
- rescue Errno ::EHOSTUNREACH
323
- raise CannotConnectError , "Error connecting to Redis on #{ location } (EHOSTUNREACH)"
318
+ rescue TimeoutError ,
319
+ Errno ::ECONNREFUSED ,
320
+ Errno ::EHOSTDOWN ,
321
+ Errno ::EHOSTUNREACH ,
322
+ Errno ::ENETUNREACH ,
323
+ Errno ::ETIMEDOUT
324
+
325
+ raise CannotConnectError , "Error connecting to Redis on #{ location } (#{ $!. class } )"
324
326
end
325
327
326
328
def ensure_connected
You can’t perform that action at this time.
0 commit comments