More informative error message when cannot load a store

I tried to use `mozilla` store, but got the following message, that gave me no clue what's wrong:

          ArgumentError: cookie store unavailable: :mozilla

After some debugging I found that I have no `sqlite3` gem installed. But the error message should tell mi that. 

This change should help.
This commit is contained in:
wrzasa 2016-03-16 13:15:58 +01:00 committed by wrzasa
parent 1c4a7bbe4b
commit f828cf0319

View file

@ -17,8 +17,8 @@ class HTTP::CookieJar::AbstractStore
begin
require 'http/cookie_jar/%s_store' % symbol
@@class_map.fetch(symbol)
rescue LoadError, IndexError
raise IndexError, 'cookie store unavailable: %s' % symbol.inspect
rescue LoadError, IndexError => e
raise IndexError, 'cookie store unavailable: %s, error: %s' % symbol.inspect, e.message
end
end