Skip to content

Instantly share code, notes, and snippets.

@alekseyl
Created February 17, 2017 11:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alekseyl/cb7af091d4dfc137dd1dc1c13549767c to your computer and use it in GitHub Desktop.
Save alekseyl/cb7af091d4dfc137dd1dc1c13549767c to your computer and use it in GitHub Desktop.
run_async_with_rescue example
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment