Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
airbrake-ruby: ignore SystemExit in the
at_exit
hook
Fixes #13 (Unnecessary airbrake error when running unknown rake task) The problem with Rake is that on unknown task it [raises SystemExit][1] with help of [`Kernel.exit`][2], which we catch and try to send to Airbrake, which results in an Airbrake::Error. This is the easiest fix. I tried messing with the airbrake gem to load the Airbrake config when you launch a Rake task inside a Rails app, but it's not easy to do: the Rails app is not initialised at that moment. I stopped digging there, because I was getting into the rabbit hole. [1]: https://github.com/ruby/rake/blob/805c13ab52eae9df55f9030f40c7fbc1beadc105/lib/rake/application.rb#L191 [2]: http://ruby-doc.org/core-2.2.3/Kernel.html#method-i-exit
- Loading branch information