Skip to content
This repository has been archived by the owner on Dec 11, 2023. It is now read-only.

Listen for correct Faraday error #145

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions lib/librato/metrics/middleware/retry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ def call(env)
begin
env[:body] = request_body # after failure is set to response body
@app.call(env)
rescue Librato::Metrics::ServerError, Timeout::Error,
Faraday::Error::ConnectionFailed
rescue Librato::Metrics::ServerError, Timeout::Error, Faraday::ConnectionFailed
if retries > 0
retries -= 1 and retry
end
Expand All @@ -28,4 +27,4 @@ def call(env)

end
end
end
end