-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix rspec failure when using webmock v2.2.0 or above #65
Fix rspec failure when using webmock v2.2.0 or above #65
Conversation
Sorry, I can't commit from where I'm at; so, I'm writing a comment. Couldn't you check the --- a/lib/flexirest/connection.rb
+++ b/lib/flexirest/connection.rb
@@ -26,11 +26,17 @@ module Flexirest
block.call
rescue Faraday::Error::TimeoutError
raise Flexirest::TimeoutException.new("Timed out getting #{full_url(path)}")
- rescue Faraday::Error::ConnectionFailed
+ rescue Faraday::Error::ConnectionFailed => err
+ if err.cause.is_a?(Net::OpenTimeout)
+ raise Flexirest::TimeoutException.new("Timed out getting #{full_url(path)}")
+ end
begin
reconnect
block.call
- rescue Faraday::Error::ConnectionFailed
+ rescue Faraday::Error::ConnectionFailed => err
+ if err.cause.is_a?(Net::OpenTimeout)
+ raise Flexirest::TimeoutException.new("Timed out getting #{full_url(path)}")
+ end
raise Flexirest::ConnectionFailedException.new("Unable to connect to #{full_url(path)}")
end
end |
Unfortunately |
I can't figure out why Maybe some gem has been updated and the test just needs to be run again?
|
d9544c3
to
4940be4
Compare
Webmock is now raising `Net::OpenTimeout` in `to_timeout` since v2.2.0. However, faraday is raising `Faraday::Error::ConnectionFailed` when it rescued `Net::OpenTimeout` on v0.11.0 * https://github.com/bblimke/webmock/blob/v2.3.2/CHANGELOG.md#220 * bblimke/webmock#659 * https://github.com/lostisland/faraday/blob/v0.11.0/lib/faraday/adapter/net_http.rb#L29-L57
4940be4
to
92d9a5b
Compare
Hi, @andyjeffries and @execjosh Thank you for your review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm 👍
Me too, thanks for the PR. |
This is a
temporaryfix to make rspec work well.Webmock is now raising
Net::OpenTimeout
into_timeout
since v2.2.0.However, faraday is raising
Faraday::Error::ConnectionFailed
when it rescuedNet::OpenTimeout
on v0.11.0