mirror of
				https://github.com/lingble/chatwoot.git
				synced 2025-10-31 11:08:04 +00:00 
			
		
		
		
	 abe57873db
			
		
	
	abe57873db
	
	
	
		
			
			- 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
 |