diff --git a/spec/client_spec.rb b/spec/client_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/client_spec.rb
+++ b/spec/client_spec.rb
@@ -1121,7 +1121,7 @@ describe 'Client' do
   it "should use request options" do
     expect{Algolia.list_indexes}.to_not raise_error
 
-    expect{Algolia.list_indexes('headers' => { 'X-Algolia-API-Key' => 'NotExistentAPIKey' })}.to raise_error
+    expect{Algolia.list_indexes('headers' => { 'X-Algolia-API-Key' => 'NotExistentAPIKey' })}.to raise_error(Algolia::AlgoliaProtocolError)
   end
 
   context 'DNS timeout' do
fix(tests): Fix warning for unspecified exception (#<I>)