Sha256: ea46177b456b183d6e41e8bb4fad2f0c3ec1ea68fb9d949aa21635691fb1e41d

Contents?: true

Size: 742 Bytes

Versions: 40

Compression:

Stored size: 742 Bytes

Contents

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

  def after_response(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

40 entries across 40 versions & 2 rubygems

Version Path
lhc-7.3.3 lib/lhc/interceptors/rollbar.rb
lhc-7.3.2 lib/lhc/interceptors/rollbar.rb
lhc-7.3.1 lib/lhc/interceptors/rollbar.rb
lhc-7.3.0 lib/lhc/interceptors/rollbar.rb
lhc-7.2.0 lib/lhc/interceptors/rollbar.rb
lhc-7.1.0 lib/lhc/interceptors/rollbar.rb
lhc-7.0.1 lib/lhc/interceptors/rollbar.rb
lhc-7.0.0 lib/lhc/interceptors/rollbar.rb
lhc-7.0.0.beta1 lib/lhc/interceptors/rollbar.rb
lhc-6.7.2 lib/lhc/interceptors/rollbar.rb
lhc-6.7.1 lib/lhc/interceptors/rollbar.rb
lhc-6.7.0 lib/lhc/interceptors/rollbar.rb
lhc-6.6.0.zipkin.pre.03 lib/lhc/interceptors/rollbar.rb
lhc-6.6.0.zipkin.pre.02 lib/lhc/interceptors/rollbar.rb
lhc-6.6.0.zipkin.pre.01 lib/lhc/interceptors/rollbar.rb
lhc-6.6.0.zipkin.pre lib/lhc/interceptors/rollbar.rb
lhc-6.6.0 lib/lhc/interceptors/rollbar.rb
lhc-6.5.0 lib/lhc/interceptors/rollbar.rb
lhc-6.4.0 lib/lhc/interceptors/rollbar.rb
lhc-6.3.1 lib/lhc/interceptors/rollbar.rb