Show exception ids on error pages, so support can see all details
Ruby HTML
Latest commit 579b49c Feb 16, 2017 @grosser nicer
Permalink
Failed to load latest commit information.
assets nicer Feb 16, 2017
example nicer Feb 16, 2017
lib/airbrake v0.1.3 Feb 12, 2017
spec integration test Feb 12, 2017
.rubocop.yml integration test Feb 12, 2017
.travis.yml fix travis bug Feb 11, 2017
Gemfile tests Feb 11, 2017
Gemfile.lock v0.1.3 Feb 12, 2017
MIT-LICENSE initial by http://github.com/grosser/project_template Feb 10, 2017
Rakefile integration test Feb 12, 2017
Readme.md nicer Feb 16, 2017
airbrake-user_informer.gemspec example app Feb 11, 2017

Readme.md

Show rails exception ids on error pages so users or support can track them down faster

Example

Install

gem install airbrake-user_informer

Usage

# Gemfile
gem 'airbrake'
gem 'airbrake-user_informer'

# config/initializers/airbrake.rb
Airbrake.configure do |config|
  ... regular config ...
end

Airbrake.user_information = # replaces <!-- AIRBRAKE ERROR --> on 500 pages
  "<br/><br/>Error number: <a href='https://airbrake.io/locate/{{error_id}}'>{{error_id}}</a>"

# public/500.html
<!-- AIRBRAKE ERROR -->

Details

  • adds a new middleware to wait for exception to report (max 1s) and render error id
  • modifies Airbrake::Rack::Middleware to store the exceptions it sends to airbrake
  • adds Airbrake.user_information accessor for configuration

Development

  • run tests: bundle && rake default integration (travis cannot run integration tests)
  • example app: cd example && bundle && rails s then go to localhost:3000 or localhost:3000/error

PR needed for

  • rails 4.2 support
  • ruby 2.1 support

Author

Michael Grosser
michael@grosser.it
License: MIT
Build Status