Skip to content

Commit

Permalink
have EMHttp handle Errno::ECONNREFUSED error
Browse files Browse the repository at this point in the history
  • Loading branch information
mislav committed Jan 28, 2012
1 parent 97b24b9 commit 0a94138
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/faraday/adapter/em_http.rb
Expand Up @@ -73,6 +73,9 @@ def raise_error(msg)
if msg == Errno::ETIMEDOUT
errklass = Faraday::Error::TimeoutError
msg = "request timed out"
elsif msg == Errno::ECONNREFUSED
errklass = Faraday::Error::ConnectionFailed
msg = "connection refused"
end
raise errklass, msg
end
Expand Down

0 comments on commit 0a94138

Please sign in to comment.