Class: Sentinel::ApiClient

Inherits:
Object
  • Object
show all
Defined in:
lib/sentinel/api_client.rb

Class Method Summary collapse

Class Method Details

.send_to_server(record) ⇒ Object



6
7
8
9
10
11
12
13
# File 'lib/sentinel/api_client.rb', line 6

def send_to_server(record)
  response = ::HTTParty.public_send(configuration.method, configuration.uri, prepare_request(record))
  unless response.code == 200
    Sentinel.default_logger.warn("We sent logs(#{record}) to API Server and got #{response.code} instead of status")
  end
rescue => e
  Sentinel.default_logger.warn("Troubles with ErrorReporter API call\n #{e.message}\n #{e.backtrace}")
end