Skip to content

Commit

Permalink
retry on transient wrapped httpi errors (#566)
Browse files Browse the repository at this point in the history
* add httpclient timeout to backoff since it is the most preferred by httpi

* retry http client error subclasses since we use include? instead of is_a? on these

* retry on transient wrapped httpi errors too
  • Loading branch information
ericcj authored Oct 3, 2022
1 parent 4a3fff4 commit 01bf4c9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/netsuite/utilities.rb
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ def backoff(options = {})
exceptions_to_retry << OpenSSL::SSL::SSLErrorWaitReadable if defined?(OpenSSL::SSL::SSLErrorWaitReadable)

# depends on the http library chosen
exceptions_to_retry << HTTPI::SSLError if defined?(HTTPI::SSLError)
exceptions_to_retry << HTTPI::TimeoutError if defined?(HTTPI::TimeoutError)
exceptions_to_retry << HTTPClient::TimeoutError if defined?(HTTPClient::TimeoutError)
exceptions_to_retry << HTTPClient::ConnectTimeoutError if defined?(HTTPClient::ConnectTimeoutError)
exceptions_to_retry << HTTPClient::ReceiveTimeoutError if defined?(HTTPClient::ReceiveTimeoutError)
Expand Down

0 comments on commit 01bf4c9

Please sign in to comment.