Skip to content

Commit

Permalink
Make sure we use an adapter for our faraday connection
Browse files Browse the repository at this point in the history
When adding middleware to the faraday connection we need to
be explicit about which adapter we'll use, otherwise no HTTP
requests are actually made.

Sadly, Faraday doesn't raise an exception if the adapter is
missing and you end up debugging cryptic error messages raised
from the middleware 🐼

For more information see:
lostisland/faraday#317
  • Loading branch information
manmartinez committed Oct 11, 2017
1 parent 557ac21 commit 4b31343
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/newgistics/api.rb
Expand Up @@ -15,6 +15,7 @@ def post(request, response_handler)
def connection
@connection ||= Faraday.new(url: host_url) do |faraday|
faraday.response :logger, Newgistics.logger, bodies: true
faraday.adapter Faraday.default_adapter
end
end

Expand Down

0 comments on commit 4b31343

Please sign in to comment.