Reporting controller: don't eat errors in development mode. log errors in production.

pull/6827/head
Konstantin Haase 14 years ago
parent 5ab6f6b773
commit ef3eb06afe
  1. 20
      app/controllers/cost_reports_controller.rb

@ -6,9 +6,23 @@ class CostReportsController < ApplicationController
rescue_from Exception do |exception|
session.delete(:report)
@custom_errors ||= []
@custom_errors << l(:error_generic)
render :layout => !request.xhr?
if Rails.env == "production"
@custom_errors ||= []
@custom_errors << l(:error_generic)
render :layout => !request.xhr?
logger.fatal <<-THE_ERROR
==============================================================================
REPORTING ERROR:
#{exception.class}: #{exception.message}
#{exception.backtrace.join("\n ")}
==============================================================================
THE_ERROR
else
raise exception
end
end
helper :reporting

Loading…
Cancel
Save