Sha256: 1186d893ad63b657880e97d4a59801feb248c17e573b2ed979e1862aa2507b15

Contents?: true

Size: 732 Bytes

Versions: 22

Compression:

Stored size: 732 Bytes

Contents

class LHC::Rollbar < LHC::Interceptor
  include ActiveSupport::Configurable

  def after_response
    return unless Object.const_defined?('Rollbar')
    return if response.success?
    request = response.request
    additional_params = request.options.fetch(:rollbar, {})
    data = {
      response: {
        body: response.body,
        code: response.code,
        headers: response.headers,
        time: response.time,
        timeout?: response.timeout?
      },
      request: {
        url: request.url,
        method: request.method,
        headers: request.headers,
        params: request.params
      }
    }.merge additional_params
    Rollbar.warning("Status: #{response.code} URL: #{request.url}", data)
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
lhc-10.1.2 lib/lhc/interceptors/rollbar.rb
lhc-10.1.1 lib/lhc/interceptors/rollbar.rb
lhc-10.1.0 lib/lhc/interceptors/rollbar.rb
lhc-10.0.2 lib/lhc/interceptors/rollbar.rb
lhc-9.4.4 lib/lhc/interceptors/rollbar.rb
lhc-10.0.1 lib/lhc/interceptors/rollbar.rb
lhc-10.0.0 lib/lhc/interceptors/rollbar.rb
lhc-9.4.3 lib/lhc/interceptors/rollbar.rb
lhc-9.4.2 lib/lhc/interceptors/rollbar.rb
lhc-9.4.1 lib/lhc/interceptors/rollbar.rb
lhc-9.4.0 lib/lhc/interceptors/rollbar.rb
lhc-9.3.1 lib/lhc/interceptors/rollbar.rb
lhc-9.3.0 lib/lhc/interceptors/rollbar.rb
lhc-9.2.0 lib/lhc/interceptors/rollbar.rb
lhc-9.1.2 lib/lhc/interceptors/rollbar.rb
lhc-9.1.2.pre lib/lhc/interceptors/rollbar.rb
lhc-9.1.1 lib/lhc/interceptors/rollbar.rb
lhc-8.1.1 lib/lhc/interceptors/rollbar.rb
lhc-9.1.0 lib/lhc/interceptors/rollbar.rb
lhc-9.0.0 lib/lhc/interceptors/rollbar.rb