lib/footrest/connection.rb in footrest-0.2.0 vs lib/footrest/connection.rb in footrest-0.2.2

- old
+ new

@@ -1,8 +1,9 @@ require 'faraday' require 'faraday_middleware' -require 'faraday/response/raise_footrest_http_error' +require 'footrest/http_error' +require 'footrest/pagination' module Footrest module Connection attr_reader :connection @@ -13,10 +14,11 @@ faraday.request :url_encoded faraday.response :logger if config[:logging] faraday.adapter Faraday.default_adapter faraday.use FaradayMiddleware::FollowRedirects faraday.use FaradayMiddleware::ParseJson, :content_type => /\bjson$/ - faraday.use Faraday::Response::RaiseFootrestHttpError + faraday.use Footrest::RaiseFootrestErrors + faraday.use Footrest::Pagination faraday.headers[:accept] = "application/json" faraday.headers[:authorization] = "Bearer #{config[:token]}" if config[:token] faraday.headers[:user_agent] = "Footrest" end end \ No newline at end of file