diff --git a/lib/linked_in/connection.rb b/lib/linked_in/connection.rb index 404331f..2d2a024 100644 --- a/lib/linked_in/connection.rb +++ b/lib/linked_in/connection.rb @@ -16,8 +16,8 @@ def initialize(url=nil, options=nil, &block) # We need to use the FlatParamsEncoder so we can pass multiple of # the same param to certain endpoints (like the search API). self.options.params_encoder = ::Faraday::FlatParamsEncoder - - self.response :linkedin_raise_error + middleware = Faraday::RackBuilder::Handler.new(LinkedIn::RaiseError) + self.builder.handlers.push(middleware) end diff --git a/linkedin-oauth2.gemspec b/linkedin-oauth2.gemspec index c061e85..b7caacc 100644 --- a/linkedin-oauth2.gemspec +++ b/linkedin-oauth2.gemspec @@ -20,9 +20,9 @@ Gem::Specification.new do |gem| # To support native JSON. Same requirements as Rails. gem.required_ruby_version = '>= 1.9.3' - gem.add_dependency "oauth2", "~> 1.0" + gem.add_dependency "oauth2" gem.add_dependency "hashie", "~> 3.2" - gem.add_dependency "faraday", "~> 0.9" + gem.add_dependency "faraday", "~> 0.14.0" gem.add_development_dependency "rake" gem.add_development_dependency "rspec", "~> 3.0"