Use upstream patch for net-http-persistent 4.0
This commit is contained in:
parent
01813feef7
commit
ebc2b1ef4e
2 changed files with 24 additions and 15 deletions
24
faraday-1.0.1-net-http-persistent-3-error-kind.patch
Normal file
24
faraday-1.0.1-net-http-persistent-3-error-kind.patch
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
From 687108bb4ddc2511aeaae7449dd401fe62dd5ceb Mon Sep 17 00:00:00 2001
|
||||
From: Matt <iMacTia@users.noreply.github.com>
|
||||
Date: Thu, 31 Dec 2020 10:51:03 +0000
|
||||
Subject: [PATCH] Adds Ruby 3.0 to CI Matrix (#1226)
|
||||
|
||||
---
|
||||
.github/workflows/ci.yml | 6 +-----
|
||||
Gemfile | 2 +-
|
||||
lib/faraday/adapter/net_http_persistent.rb | 2 +-
|
||||
3 files changed, 3 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/lib/faraday/adapter/net_http_persistent.rb b/lib/faraday/adapter/net_http_persistent.rb
|
||||
index ff20c256..26bcc2ce 100644
|
||||
--- a/lib/faraday/adapter/net_http_persistent.rb
|
||||
+++ b/lib/faraday/adapter/net_http_persistent.rb
|
||||
@@ -51,7 +51,7 @@ def proxy_uri(env)
|
||||
|
||||
def perform_request(http, env)
|
||||
http.request env[:url], create_request(env)
|
||||
- rescue Errno::ETIMEDOUT => e
|
||||
+ rescue Errno::ETIMEDOUT, Net::OpenTimeout => e
|
||||
raise Faraday::TimeoutError, e
|
||||
rescue Net::HTTP::Persistent::Error => e
|
||||
raise Faraday::TimeoutError, e if e.message.include? 'Timeout'
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
--- faraday-1.0.1/lib/faraday/adapter/net_http_persistent.rb.persistent4 2021-02-20 14:29:13.644561286 +0900
|
||||
+++ faraday-1.0.1/lib/faraday/adapter/net_http_persistent.rb 2021-02-20 14:29:52.521616996 +0900
|
||||
@@ -59,6 +59,12 @@ module Faraday
|
||||
if e.message.include? 'connection refused'
|
||||
raise Faraday::ConnectionFailed, e
|
||||
end
|
||||
+ rescue Net::OpenTimeout => e
|
||||
+ raise Faraday::TimeoutError, e if e.message.include? 'execution expired'
|
||||
+
|
||||
+ if e.message.include? 'connection refused'
|
||||
+ raise Faraday::ConnectionFailed, e
|
||||
+ end
|
||||
|
||||
raise
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue