Coder Social home page Coder Social logo

gbuesing / rack_hoptoad Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zapnap/rack_hoptoad

1.0 1.0 1.0 89 KB

middleware for posting exceptions to http://hoptoadapp.com

Home Page: http://github.com/atmos/rack_hoptoad

License: MIT License

Ruby 100.00%

rack_hoptoad's Introduction

rack_hoptoad

A gem that provides exception notifications to hoptoad 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)
end

If 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'
end

If 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)
end

Installation

% sudo gem install rack_hoptoad

Sinatra 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
end

Note 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.

rack_hoptoad's People

Contributors

atmos avatar gbuesing avatar

Stargazers

 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.