lib/redis_failover/node.rb in nogara-redis_failover-0.9.1 vs lib/redis_failover/node.rb in nogara-redis_failover-0.9.7

- old
+ new

@@ -116,11 +116,10 @@ return true if self.equal?(other) [host, port] == [other.host, other.port] end alias_method :eql?, :== - # @return [Integer] a hash value for this node def hash to_s.hash end @@ -173,17 +172,17 @@ redis = nil Timeout.timeout(MAX_OP_WAIT_TIME) do redis = new_client yield redis end - rescue - raise NodeUnavailableError, self, caller + rescue Exception => ex + raise NodeUnavailableError, "#{ex.class}: #{ex.message}", ex.backtrace ensure if redis begin redis.client.disconnect - rescue - raise NodeUnavailableError, self, caller + rescue Exception => ex + raise NodeUnavailableError, "#{ex.class}: #{ex.message}", ex.backtrace end end end end end