Skip to content

Commit

Permalink
lint: fix alignment and rescue stmt
Browse files Browse the repository at this point in the history
  • Loading branch information
technoweenie committed Sep 20, 2019
1 parent bfe360a commit ba7b82d
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions lib/faraday/adapter/patron.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,13 @@ def call(env)
env[:body] = env[:body].read if env[:body].respond_to? :read

response = connection(env) do |session|
data = env[:body] ? env[:body].to_s : nil
session.request(env[:method], env[:url].to_s,
env[:request_headers], data: data)
rescue Errno::ECONNREFUSED, ::Patron::ConnectionFailed
raise Faraday::ConnectionFailed, $ERROR_INFO
begin
data = env[:body] ? env[:body].to_s : nil
session.request(env[:method], env[:url].to_s,
env[:request_headers], data: data)
rescue Errno::ECONNREFUSED, ::Patron::ConnectionFailed
raise Faraday::ConnectionFailed, $ERROR_INFO
end
end

if (req = env[:request]).stream_response?
Expand Down

0 comments on commit ba7b82d

Please sign in to comment.