diff --git a/app/services/web_hook_service.rb b/app/services/web_hook_service.rb index a5110a23cad9ffce1ec97a27205507d2451823b6..27c3ba197ac8ea6b650aefa313596e7a64b431c1 100644 --- a/app/services/web_hook_service.rb +++ b/app/services/web_hook_service.rb @@ -44,7 +44,7 @@ class WebHookService http_status: response.code, message: response.to_s } - rescue SocketError, OpenSSL::SSL::SSLError, Errno::ECONNRESET, Errno::ECONNREFUSED, Net::OpenTimeout => e + rescue SocketError, OpenSSL::SSL::SSLError, Errno::ECONNRESET, Errno::ECONNREFUSED, Errno::EHOSTUNREACH, Net::OpenTimeout, Net::ReadTimeout => e log_execution( trigger: hook_name, url: hook.url, diff --git a/spec/services/web_hook_service_spec.rb b/spec/services/web_hook_service_spec.rb index a5de86a083565f42ef2fc6d18befe9ffb27f7db1..e79c12daa1c222d3a89c5bc74350f139f39e734f 100644 --- a/spec/services/web_hook_service_spec.rb +++ b/spec/services/web_hook_service_spec.rb @@ -53,7 +53,7 @@ describe WebHookService do end it 'handles exceptions' do - exceptions = [SocketError, OpenSSL::SSL::SSLError, Errno::ECONNRESET, Errno::ECONNREFUSED, Net::OpenTimeout] + exceptions = [SocketError, OpenSSL::SSL::SSLError, Errno::ECONNRESET, Errno::ECONNREFUSED, Errno::EHOSTUNREACH, Net::OpenTimeout, Net::ReadTimeout] exceptions.each do |exception_class| exception = exception_class.new('Exception message')