From 01bf4c91e8bd159fe4f9794b8a0e5e39cd45d983 Mon Sep 17 00:00:00 2001 From: Eric Jensen Date: Mon, 3 Oct 2022 13:22:54 -0400 Subject: [PATCH] retry on transient wrapped httpi errors (#566) * 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 --- lib/netsuite/utilities.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/netsuite/utilities.rb b/lib/netsuite/utilities.rb index 4f4bbf24..a855a122 100644 --- a/lib/netsuite/utilities.rb +++ b/lib/netsuite/utilities.rb @@ -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)