- Faraday::ClientError update (#184)

  • Faraday::ClientError update (#184)
diff --git a/lib/discourse_api/client.rb b/lib/discourse_api/client.rb
index 746fcdb..18f18eb 100644
--- a/lib/discourse_api/client.rb
+++ b/lib/discourse_api/client.rb
@@ -140,7 +140,7 @@ module DiscourseApi
       response = connection.send(method.to_sym, path, params)
       handle_error(response)
       response.env
-    rescue Faraday::Error::ClientError, JSON::ParserError
+    rescue Faraday::ClientError, JSON::ParserError
       raise DiscourseApi::Error
     end
 
diff --git a/spec/discourse_api/client_spec.rb b/spec/discourse_api/client_spec.rb
index f15de6d..b1243f7 100644
--- a/spec/discourse_api/client_spec.rb
+++ b/spec/discourse_api/client_spec.rb
@@ -149,7 +149,7 @@ describe DiscourseApi::Client do
     end
 
     it "catches Faraday errors" do
-      allow(subject).to receive(:connection).and_raise(Faraday::Error::ClientError.new("BOOM!"))
+      allow(subject).to receive(:connection).and_raise(Faraday::ClientError.new("BOOM!"))
       expect{subject.send(:request, :get, "/test")}.to raise_error DiscourseApi::Error
     end

GitHub sha: 20caaa85