Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Iron_Cache (Iron_Core, 1.0.2 update): Error when retrieving object for key that doesn't exist #89

Closed
eappleby opened this Issue · 2 comments

2 participants

@eappleby

I created simple test script that reproduces error:

Here is error message:
/app/vendor/bundle/ruby/1.9.1/gems/iron_core-1.0.2/lib/iron_core/client.rb:195:in extract_error_msg', undefined methodmsg=' for #Rest::Wrappers::RestClientExceptionWrapper:0x000000030ad040

Gemfile
source 'https://rubygems.org'
ruby '1.9.3'
gem 'sinatra', '1.1.0'
gem 'iron_core', '1.0.2'
gem 'iron_cache, '1.4.0'

Test Script

require 'sinatra'
require 'json'
require 'iron_cache'

begin
    ironcache = IronCache::Client.new
    cache = ironcache.cache("test")
rescue => e
    cache = nil
    $stderr.puts "1. #{e.backtrace[0]}, #{e.message}"
end

get "/test" do 
    cache_key = "test"
    cache_result = nil

    begin
        if not cache.nil?
            cache_result = cache.get(cache_key)
            if not cache_result.nil?
                cache_result.value.to_s
            else
                val = "123"
                cache.put(cache_key, val.to_json, {:expires_in => 5})
                "not found"
            end
        end
    rescue => e
        $stderr.puts "2. #{cache_key}: #{e.backtrace[0]}, #{e.message}"
        "error"
    end
end
@treeder
Owner

I think I know this one, checking it now.

@treeder
Owner

Please update your rest gem to 2.6.5, fixes the bug. Sorry about that.

@treeder treeder closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.