I am trying to create custom error pages in a project of rails 3.0.20 and ruby 1.8.7.
Anyway in my application controller:
unless Rails.application.config.consider_all_requests_local
rescue_from Exception, :with => :render_error
rescue_from ActionController::RoutingError, ActionController::UnknownController, ::AbstractController::ActionNotFound, ActiveRecord::RecordNotFound, :with => :render_error_not_found
end
Then the render error method:
def render_error(exception)
notify_airbrake(exception)
Rails.logger.fatal exception
Rails.logger.fatal exception.backtrace.join("\n")
respond_to do |format|
format.html { render :template => "errors/error_500", :layout => 'layouts/application'}
format.all { render :nothing => true, :status => 500 }
end
end
It seems that now my logs are being filled with a much longer then usual backtrace. Why is that happening? Is there a way to show just the "important" part of a backtrace? And is it correct to call airbrake here?
Thanks