File tree Expand file tree Collapse file tree 4 files changed +21
-28
lines changed
Expand file tree Collapse file tree 4 files changed +21
-28
lines changed Original file line number Diff line number Diff line change 1515require 'httparty/decompressor'
1616require 'httparty/text_encoder'
1717require 'httparty/headers_processor'
18- require 'httparty/common_errors'
1918
2019# @see HTTParty::ClassMethods
2120module HTTParty
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11# frozen_string_literal: true
22
33module HTTParty
4+ FOUL_ERRORS = [
5+ EOFError ,
6+ Errno ::ECONNABORTED ,
7+ Errno ::ECONNREFUSED ,
8+ Errno ::ECONNRESET ,
9+ Errno ::EHOSTUNREACH ,
10+ Errno ::EINVAL ,
11+ Errno ::ENETUNREACH ,
12+ Errno ::ENOTSOCK ,
13+ Errno ::EPIPE ,
14+ Errno ::ETIMEDOUT ,
15+ Net ::HTTPBadResponse ,
16+ Net ::HTTPHeaderSyntaxError ,
17+ Net ::ProtocolError ,
18+ Net ::ReadTimeout ,
19+ OpenSSL ::SSL ::SSLError ,
20+ SocketError ,
21+ Timeout ::Error # Also covers subclasses like Net::OpenTimeout
22+ ] . freeze
23+
424 # @abstract Exceptions raised by HTTParty inherit from Error
525 class Error < StandardError ; end
626
Original file line number Diff line number Diff line change @@ -172,7 +172,7 @@ def perform(&block)
172172 result = handle_unauthorized
173173 result ||= handle_response ( chunked_body , &block )
174174 result
175- rescue *CommonErrors :: NETWORK_ERRORS => e
175+ rescue *FOUL_ERRORS => e
176176 raise options [ :foul ] ? HTTParty ::Foul . new ( "#{ e . class } : #{ e . message } " ) : e
177177 end
178178 end
You can’t perform that action at this time.
0 commit comments