Skip to content

Commit

Permalink
Use response[:status] instead of the less reliable response[:response…
Browse files Browse the repository at this point in the history
…_headers]['status']
  • Loading branch information
sferik committed Dec 25, 2010
1 parent 7ba01a0 commit b115038
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/faraday/raise_http_4xx.rb
Expand Up @@ -31,7 +31,7 @@ def initialize(app)
private

def self.error_message(response)
"#{response[:method].to_s.upcase} #{response[:url].to_s}: #{response[:response_headers]['status']}#{error_body(response[:body])}"
"#{response[:method].to_s.upcase} #{response[:url].to_s}: #{response[:status]}#{error_body(response[:body])}"
end

def self.error_body(body)
Expand Down
2 changes: 1 addition & 1 deletion lib/faraday/raise_http_5xx.rb
Expand Up @@ -25,7 +25,7 @@ def initialize(app)
private

def self.error_message(response, body=nil)
"#{response[:method].to_s.upcase} #{response[:url].to_s}: #{response[:response_headers]['status']}:#{(' ' + body) if body} Check http://status.twitter.com/ for updates on the status of the Twitter service."
"#{response[:method].to_s.upcase} #{response[:url].to_s}: #{[response[:status].to_s + ':', body].compact.join(' ')} Check http://status.twitter.com/ for updates on the status of the Twitter service."
end
end
end

0 comments on commit b115038

Please sign in to comment.