lib/http/cookie_jar/abstract_store.rb in http-cookie-0.1.1 vs lib/http/cookie_jar/abstract_store.rb in http-cookie-0.1.2

- old
+ new

@@ -4,18 +4,18 @@ class << self @@class_map = {} # Gets an implementation class by the name, optionally trying to # load "http/cookie_jar/*_store" if not found. If loading fails, - # KeyError is raised. + # IndexError is raised. def implementation(symbol) @@class_map.fetch(symbol) - rescue KeyError + rescue IndexError begin require 'http/cookie_jar/%s_store' % symbol @@class_map.fetch(symbol) - rescue LoadError, KeyError => e - raise KeyError, 'cookie store unavailable: %s' % symbol.inspect + rescue LoadError, IndexError => e + raise IndexError, 'cookie store unavailable: %s' % symbol.inspect end end def inherited(subclass) @@class_map[class_to_symbol(subclass)] = subclass