The project is in a healthy, maintained state
show link to errors on exception page
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 0
>= 6.1.0, < 7.3.0
 Project Readme

Show exception ids on error pages and headers, so users or support can track them down faster

Example

Install

gem 'sentry-user_informer'

Usage

# Gemfile
gem 'sentry-user_informer'

# config/initializers/sentry.rb
Sentry.configure do |config|
  ... regular config ...
end

# optional: customize placeholder (make sure it matches public/500.html)
# Sentry::UserInformer.placeholder = '<!-- SENTRY-USER-INFORMER -->'

# optional: customize template
# Sentry::UserInformer.template = # replaces `placeholder` on 500 pages
#   "<br/><br/>Error number: <a href='https://sentry.io/organizations/foo/issues/?query=%{event_id}'>%{event_id}</a>"

# public/500.html
<!-- SENTRY-USER-INFORMER -->

Details

  • adds a new middleware to render placeholder
  • modifies Sentry::Rails::Middleware to store the exceptions it sends to sentry

middleware basically ends up like this:

use Sentry::UserInformer::ExceptionRenderer # replace placeholder
use ActionDispatch::ShowExceptions          # render 500.html
use Sentry::Rails::CaptureExceptions        # store exception

Development

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

Author

Michael Grosser
michael@grosser.it
License: MIT
coverage