Files
chatwoot/lib/webhooks/trigger.rb
Sojan Jose abe57873db chore: Disable throwing Webhook exceptions to Sentry (#6663)
- There is little value in throwing the third-party webhook-related exceptions to sentry. Let's rather write it to logs instead.
2023-03-14 17:40:40 +05:30

14 lines
425 B
Ruby

class Webhooks::Trigger
def self.execute(url, payload)
response = RestClient::Request.execute(
method: :post,
url: url, payload: payload.to_json,
headers: { content_type: :json, accept: :json },
timeout: 5
)
Rails.logger.info "Performed Request: Code - #{response.code}"
rescue StandardError => e
Rails.logger.warn "Exception: invalid webhook url #{url} : #{e.message}"
end
end