Rescue Timeout::Error from Redis Gem (Ruby)
问题 I need to rescue a Timeout::Error raised from a the Redis library but i'm running into a problem, rescuing that specific class doesn't seem to work. begin Redis.new( { :host => "127.0.0.X" } ) rescue Timeout::Error => ex end => Timeout::Error: Timeout::Error from /Users/me/.rvm/gems/ree-1.8.7-2011.03@gowalla/gems/redis-2.2.0/lib/redis/connection/hiredis.rb:23:in `connect' When i try to rescue Exception it still doesn't work begin Redis.new( { :host => "127.0.0.X" } ) rescue Exception => ex