Skip to content

Instantly share code, notes, and snippets.

@shadowbq
Last active December 10, 2015 18:49
Show Gist options
  • Save shadowbq/ae8b5d8617934863cad0 to your computer and use it in GitHub Desktop.
Save shadowbq/ae8b5d8617934863cad0 to your computer and use it in GitHub Desktop.
Email Backtraces if an exception occurs in Production, else just show the user..
require 'bundler' # gem requires
Bundler.require(:default, ENV['RACK_ENV'].to_sym) # only loads environment specific gems
if ENV['RACK_ENV'] == 'production' # production config / requires
require './lib/middleware/exceptionmailer'
use Rack::ExceptionMailer,
:to => ['[email protected]'],
:from => '[email protected]',
:subject => 'Error Occurred on Rack Application'
else # development or testing only
use Rack::ShowExceptions
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment