Skip to content

Instantly share code, notes, and snippets.

@snitko
Last active December 22, 2015 21:09
Show Gist options
  • Save snitko/6531622 to your computer and use it in GitHub Desktop.
Save snitko/6531622 to your computer and use it in GitHub Desktop.
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: "error500@mystore.com",
exception_recipients: ["youremail@testemail.com"]
},
ignore_exceptions: exceptions
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment