10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
# File 'lib/exceptiontrap/notifier.rb', line 10
def send_problem(serialized_data)
url = URI.parse((Config.use_ssl? ? 'https://' : 'http://') << Config.notification_url)
client = prepare_client(url)
= HEADERS
['X-Api-Key'] = Config.api_key
response = begin
client.post(url.path, serialized_data, )
rescue TimeoutError => e
puts 'ERROR: Timeout while contacting Exceptiontrap.'
nil
rescue Exception => e
puts "ERROR: Error on sending: #{e.class} - #{e.message}"
end
end
|