Permalink
Browse files

more error handling

  • Loading branch information...
1 parent 6c42a71 commit d8559e8c11d20652bb133828819332b4cdac605c @pedro committed Mar 26, 2012
Showing with 6 additions and 0 deletions.
  1. +6 −0 lib/redis-store-rails2.rb
@@ -34,16 +34,22 @@ def delete(key, options={})
super
response = @store.del(key)
response >= 0
+ rescue Errno::ECONNREFUSED => e
+ false
end
def increment(key, amount = 1)
return nil unless @store.exists(key)
@store.incrby key, amount
+ rescue Errno::ECONNREFUSED => e
+ nil
end
def decrement(key, amount = 1)
return nil unless @store.exists(key)
@data.decrby key, amount
+ rescue Errno::ECONNREFUSED => e
+ nil
end
def clear

0 comments on commit d8559e8

Please sign in to comment.