Log web hook execution timeout events
If a web hook HTTP request is sent but no response comes within a certain time (10s by default), the hook execution fails and will be retried. This commit makes such timeouts visible in the web hook log, like connection timeouts already are. Also log "no route to host" errors.
This commit is contained in:
parent
4eebd8e195
commit
a94e91a45b
2 changed files with 2 additions and 2 deletions
|
@ -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,
|
||||
|
|
|
@ -53,7 +53,7 @@ describe WebHookService, services: true 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')
|
||||
|
||||
|
|
Loading…
Reference in a new issue