Skip to content

Commit de19bd9

Browse files
committed
Fix connection refused error wrapping when using Synchrony.
1 parent af499f0 commit de19bd9

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

lib/redis/connection/synchrony.rb

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,15 @@ class Synchrony
7272

7373
def self.connect(config)
7474
if config[:scheme] == "unix"
75-
conn = EventMachine.connect_unix_domain(config[:path], RedisClient)
75+
begin
76+
conn = EventMachine.connect_unix_domain(config[:path], RedisClient)
77+
rescue RuntimeError => e
78+
if e.message == "no connection"
79+
raise Errno::ECONNREFUSED
80+
else
81+
raise e
82+
end
83+
end
7684
elsif config[:scheme] == "rediss" || config[:ssl]
7785
raise NotImplementedError, "SSL not supported by synchrony driver"
7886
else

0 commit comments

Comments
 (0)