Class: FaradayPersistentExcon::PerformRequest
- Inherits:
-
Object
- Object
- FaradayPersistentExcon::PerformRequest
- Defined in:
- lib/faraday_persistent_excon/perform_request.rb
Instance Attribute Summary collapse
-
#env ⇒ Object
Returns the value of attribute env.
Instance Method Summary collapse
Instance Attribute Details
#env ⇒ Object
Returns the value of attribute env.
3 4 5 |
# File 'lib/faraday_persistent_excon/perform_request.rb', line 3 def env @env end |
Instance Method Details
#call(env) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/faraday_persistent_excon/perform_request.rb', line 5 def call(env) @env = env resp = nil ConnectionPools.with_connection_for(url_without_path.to_s) do |conn| resp = conn.request() end rescue ::Excon::Errors::SocketError => err case err. when /\btimeout\b/ raise Faraday::TimeoutError, err when /\bcertificate\b/ raise Faraday::SSLError, err else raise Faraday::ConnectionFailed, err end rescue ::Excon::Errors::Timeout => err raise Faraday::TimeoutError, err end |