Skip to content

Commit

Permalink
disable in production when running under rails
Browse files Browse the repository at this point in the history
  • Loading branch information
Charlie Somerville committed Dec 9, 2012
1 parent 823b408 commit f436b04
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/better_errors/rails.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
module BetterErrors
class Railtie < Rails::Railtie
initializer "better_errors.configure_rails_initialization" do
middleware = Rails.application.middleware
middleware.use BetterErrors::Middleware

BetterErrors.application_root = Rails.root.to_s
unless Rails.env.production?
Rails.application.middleware.use BetterErrors::Middleware
BetterErrors.application_root = Rails.root.to_s
end
end
end
end

1 comment on commit f436b04

@jeremyw
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make more sense to use the consider_all_requests_local environment flag to enable/disable this, the same way the current exception page works? e.g. in config/environments/development.rb:

# Show full error reports and disable caching
config.consider_all_requests_local       = true

Please sign in to comment.