Redis 라이브러리에서 발생한 Timeout::Error
을 구해야합니다. 문제가 발생하여 특정 클래스가 작동하지 않는 문제를 해결하고 있습니다.Rescue Timeout :: Error from Redis Gem (Ruby)
begin
Redis.new({ :host => "127.0.0.X" })
rescue Timeout::Error => ex
end
=> Timeout::Error: Timeout::Error from /Users/me/.rvm/gems/[email protected]/gems/redis-2.2.0/lib/redis/connection/hiredis.rb:23:in `connect'
내가 Exception
를 구출하려고 할 때 수동으로 예외를 발생하려고하면 아직도 내가 그것을 구출 할 수
begin
Redis.new({ :host => "127.0.0.X" })
rescue Exception => ex
end
=> Timeout::Error: Timeout::Error from /Users/me/.rvm/gems/[email protected]/gems/redis-2.2.0/lib/redis/connection/hiredis.rb:23:in `connect'
작동하지 않습니다하지만 난 구할 수없는 이유를 모른다 그것이 Redis 보석 (2.2.0) 내에서 호출되었을 때.
begin
raise Timeout::Error
rescue Timeout::Error => ex
puts ex
end
Timeout::Error
=> nil
단서를 어떻게 구해야합니까?
나의 경우 (위의 질문을 참조하십시오. 편집이 승인 된 경우)이 대답은 IRB의 '곤충'이 문제의 원인임을 알 수 있도록 도와줍니다. 감사합니다. Devid! –