Quantcast
Channel: Active questions tagged redis+ruby-on-rails - Stack Overflow
Viewing all articles
Browse latest Browse all 873

Ruby's redis gem seemingly returns integers in error message?

$
0
0

I've implemented a library wrapper around Ruby's Redis gem.

There are times when I call CacheManager.get("key") and it somehow triggers an error that gets caught in the rescue. The error looks like this: undefined method 'join' for 20325:Integer (NoMethodError). The obvious fix is just to call .to_s on the error.message, but I'd love to understand what's happening and why Redis is returning an integer as its error message.

class CacheManager  def self.get(k, default_value = nil)    begin      $redis_pool.with { |conn| conn.get(k) } || default_value    rescue => error      Rails.logger.error([error.message] + error.backtrace).join($/)      default_value    end  endend

Viewing all articles
Browse latest Browse all 873

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>