Skip to content

Commit

Permalink
More informative error message when cannot load a store
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
wrzasa authored and wrzasa committed Mar 18, 2016
1 parent 1c4a7bb commit f828cf0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/http/cookie_jar/abstract_store.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ def implementation(symbol)
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

Expand Down

0 comments on commit f828cf0

Please sign in to comment.