class Resque::Failure::Rollbar

Falure class to use in Resque in order to send Resque errors to the Rollbar API

Public Instance Methods

save() click to toggle source
# File lib/rollbar/plugins/resque/failure.rb, line 8
def save
  payload_with_options =
    if use_exception_level_filters?
      payload.merge(:use_exception_level_filters => true)
    else
      payload
    end

  rollbar.error(exception, payload_with_options)
end

Private Instance Methods

rollbar() click to toggle source

We want to disable async reporting since original resque-rollbar implementation disabled it.

# File lib/rollbar/plugins/resque/failure.rb, line 23
def rollbar
  notifier = ::Rollbar.notifier.scope
  notifier.configuration.use_async = false

  notifier
end
rollbar_version() click to toggle source
# File lib/rollbar/plugins/resque/failure.rb, line 34
def rollbar_version
  ::Rollbar::VERSION
end
use_exception_level_filters?() click to toggle source
# File lib/rollbar/plugins/resque/failure.rb, line 30
def use_exception_level_filters?
  Gem::Version.new(rollbar_version) > Gem::Version.new('1.3.0')
end