Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions app/workers/webhook_worker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,14 @@ def perform(account_id, event_id, endpoint_id, event_data)
end

Keygen.logger.info "[webhook_worker] Delivered webhook event: type=#{event_type.event} account=#{account.id} event=#{event.id} endpoint=#{endpoint.id} url=#{endpoint.url} code=#{res.code}"
rescue HTTParty::RedirectionTooDeep => e
Keygen.logger.warn "[webhook_worker] Failed webhook event: type=#{event_type.event} account=#{account.id} event=#{event.id} endpoint=#{endpoint.id} url=#{endpoint.url} code=REDIRECT_ERROR"

event.update!(
last_response_code: e.response.code,
last_response_body: 'REDIRECT_ERROR',
status: 'FAILED',
)
rescue OpenSSL::SSL::SSLError # Endpoint's SSL certificate is not showing as valid
Keygen.logger.warn "[webhook_worker] Failed webhook event: type=#{event_type.event} account=#{account.id} event=#{event.id} endpoint=#{endpoint.id} url=#{endpoint.url} code=SSL_ERROR"

Expand Down Expand Up @@ -251,5 +259,7 @@ def backtrace = nil

class Request
include HTTParty

no_follow true
end
end
Loading