Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/atmos/rack_hoptoad
middleware for posting exceptions to http://hoptoadapp.com
https://github.com/atmos/rack_hoptoad
Last synced: 8 days ago
JSON representation
middleware for posting exceptions to http://hoptoadapp.com
- Host: GitHub
- URL: https://github.com/atmos/rack_hoptoad
- Owner: atmos
- License: mit
- Created: 2009-05-10T23:55:12.000Z (over 15 years ago)
- Default Branch: master
- Last Pushed: 2011-08-16T15:04:30.000Z (over 13 years ago)
- Last Synced: 2024-10-14T13:04:09.315Z (3 months ago)
- Language: Ruby
- Homepage: http://github.com/atmos/rack_hoptoad
- Size: 243 KB
- Stars: 7
- Watchers: 7
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
rack_hoptoad
============A gem that provides exception notifications to [hoptoad](http://hoptoadapp.com)/[airbrake](http://airbrakeapp.com) as rack middleware.
Usage
=====
Throw something like this in your config.ru to enable notifications.require 'rack/hoptoad'
use Rack::Hoptoad, 'fd48c7d26f724503a0280f808f44b339fc65fab8'
You can also exclude certain sensitive environmental variables using the block syntax
use Rack::Hoptoad, 'fd48c7d26f724503a0280f808f44b339fc65fab8' do |notifier|
notifier.environment_filters << %w(MY_SECRET_KEY MY_SECRET_TOKEN)
endIf you want to post exceptions in an environment other than staging or production(the defaults)
use Rack::Hoptoad, 'fd48c7d26f724503a0280f808f44b339fc65fab8' do |notifier|
notifier.report_under << 'custom'
endIf you want to use an environmental variable other than RACK_ENV and still have it post
use Rack::Hoptoad, 'fd48c7d26f724503a0280f808f44b339fc65fab8', 'MERB_ENV' do |notifier|
notifier.report_under << 'custom'
notifier.environment_filters << %w(MY_SECRET_KEY MY_SECRET_TOKEN)
endInstallation
============% sudo gem install rack_hoptoad
Testing
=======You need bundler 0.9.12 installed
% sudo gem install bundler
% bundle install
% MY_HOPTOAD_API_KEY=XXXXX bundle exec rakeSinatra Notes
=============In order for exceptions to propagate up to Rack in Sinatra you need to enable raise_errors
class MyApp < Sinatra::Default
enable :raise_errors
endNote that the errors block does not execute so you'll need to handle the 500 elsewhere. Normally this is done with a 500.html in the document root.