chore: Minor API fixes (#3290)
- Log whether web-hook was successful - Inbox update shouldn't need channel params
This commit is contained in:
@@ -1,14 +1,16 @@
|
||||
class Webhooks::Trigger
|
||||
def self.execute(url, payload)
|
||||
RestClient::Request.execute(
|
||||
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 *ExceptionList::REST_CLIENT_EXCEPTIONS => e
|
||||
Rails.logger.info "Exception: invalid webhook url #{url} : #{e.message}"
|
||||
Rails.logger.error "Exception: invalid webhook url #{url} : #{e.message}"
|
||||
rescue StandardError => e
|
||||
Rails.logger.error "Exception: invalid webhook url #{url} : #{e.message}"
|
||||
Sentry.capture_exception(e)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user