Last active
December 10, 2015 18:49
-
-
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..
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
You might want to use
Or the Pony version