Method: LightStep::Transport::HTTPJSON::Failbot#track_error

Defined in:
lib/hubstep/failbot.rb

#track_error(res) ⇒ Object



42
43
44
45
46
47
48
49
# File 'lib/hubstep/failbot.rb', line 42

def track_error(res)
  return unless res.is_a?(Net::HTTPClientError) || res.is_a?(Net::HTTPServerError)
  exception = HTTPError.new("#{res.code} #{res.message}")
  exception.set_backtrace(caller)
  ::Failbot.report!(exception, app: "lightstep",
                               response_body: res.body,
                               response_uri: res.uri)
end