Class: SentinelApi::Client

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
    SentinelApi.default_logger.warn("We sent logs(#{record}) to API Server and got #{response.code} instead of status")
  end
rescue => e
  SentinelApi.default_logger.warn("Troubles with ErrorReporter API call\n #{e.message}\n #{e.backtrace}")
end