mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-01 11:37:58 +00:00
- There is little value in throwing the third-party webhook-related exceptions to sentry. Let's rather write it to logs instead.
14 lines
425 B
Ruby
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
|