From f828cf0319dc22797fad7d123b98121ba537f9c7 Mon Sep 17 00:00:00 2001 From: wrzasa Date: Wed, 16 Mar 2016 13:15:58 +0100 Subject: [PATCH] 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. --- lib/http/cookie_jar/abstract_store.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/http/cookie_jar/abstract_store.rb b/lib/http/cookie_jar/abstract_store.rb index 35d0b94..9c062ed 100644 --- a/lib/http/cookie_jar/abstract_store.rb +++ b/lib/http/cookie_jar/abstract_store.rb @@ -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