Last active
December 22, 2015 21:09
-
-
Save snitko/6531622 to your computer and use it in GitHub Desktop.
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
if Rails.env == "production" || Rails.env == "staging" | |
exceptions = [] | |
exceptions << 'ActiveRecord::RecordNotFound' | |
exceptions << 'AbstractController::ActionNotFound' | |
exceptions << 'ActionController::RoutingError' | |
exceptions << 'ActionController::InvalidAuthenticityToken' | |
server_name = case Rails.env | |
when "production" then "mystore.com" | |
when "staging" then "staging.mystore.com" | |
when "development" then "DEVELOPMENT mystore" | |
else | |
"unknown env mystore" | |
end | |
MyStore::Application.config.middleware.use ExceptionNotification::Rack, | |
email: { | |
email_prefix: "[#{server_name} error] ", | |
sender_address: "[email protected]", | |
exception_recipients: ["[email protected]"] | |
}, | |
ignore_exceptions: exceptions | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment