Skip to content

Commit

Permalink
Merge pull request #61 from airbrake/at-exit-hook-deletion
Browse files Browse the repository at this point in the history
airbrake-ruby: don't report unhandled exceptions
  • Loading branch information
kyrylo committed Mar 11, 2016
2 parents dbb84d8 + d013d43 commit ae0227c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ Airbrake Ruby Changelog
c.whitelist_keys = [:page_id, 'user']
end
```

* **IMPORTANT**: dropped support for reporting critical exceptions that
terminate the process. This bit of functionality was moved to the
[airbrake gem](https://github.com/airbrake/airbrake/pull/526) instead
([#61](https://github.com/airbrake/airbrake-ruby/pull/61))
* Started filtering the context payload
([#55](https://github.com/airbrake/airbrake-ruby/pull/55))
* Fixed bug when similar keys would be filtered out using non-regexp values for
Expand Down Expand Up @@ -74,7 +77,6 @@ Airbrake Ruby Changelog

* Initial release

[airbrake-gem]: https://github.com/airbrake/airbrake
[v1.0.0.rc.1]: https://github.com/airbrake/airbrake-ruby/releases/tag/v1.0.0.rc.1
[v1.0.0]: https://github.com/airbrake/airbrake-ruby/releases/tag/v1.0.0
[v1.0.1]: https://github.com/airbrake/airbrake-ruby/releases/tag/v1.0.1
Expand Down
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,19 @@ In order to run benchmarks against `master`, add the `lib` directory to your
ruby -Ilib benchmarks/notify_async_vs_sync.rb
```

### Reporting critical exceptions

Critical exceptions are unhandled exceptions that terminate your program. By
default, the library doesn't report them. However, you can either depend on the
[airbrake gem][airbrake-gem] instead, which supports them, or you can add
the following code somewhere in your app:

```ruby
at_exit do
Airbrake.notify_sync($!) if $!
end
```

Supported Rubies
----------------

Expand Down
6 changes: 0 additions & 6 deletions lib/airbrake-ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
require 'json'
require 'thread'
require 'set'
require 'English'
require 'socket'

require 'airbrake-ruby/version'
Expand Down Expand Up @@ -293,8 +292,3 @@ def call_notifier(notifier, method, *args, &block)
end
end
end

# Notify of unhandled exceptions, if there were any, but ignore SystemExit.
at_exit do
Airbrake.notify_sync($ERROR_INFO) if $ERROR_INFO
end

0 comments on commit ae0227c

Please sign in to comment.