module AirbrakeNotifyingThreads

Constants

VERSION

Public Instance Methods

run_async_with_rescue( airbrake_params = {} ) { || ... } click to toggle source
# File lib/airbrake_notifying_threads.rb, line 6
def run_async_with_rescue( airbrake_params = {} )
  backtrace = Kernel.caller
  Thread.new do
    begin
      yield
    rescue => e
      e.set_backtrace( backtrace )
      notice = Airbrake.build_notice(e, airbrake_params)
      Airbrake.notify(notice) if notice
    end
  end
end