From 91270f4567319ad7fbb212c5b8b44edbe6ee1687 Mon Sep 17 00:00:00 2001 From: Toks Date: Tue, 25 Nov 2014 21:04:03 -0500 Subject: [PATCH] Fix 404/timeout errors not showing --- app/controllers/application_controller.rb | 2 -- app/views/static/error.html.erb | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 8ee671255..9608ad8cc 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -32,11 +32,9 @@ protected @exception = exception if exception.is_a?(::ActiveRecord::StatementInvalid) && exception.to_s =~ /statement timeout/ - @exception = nil @error_message = "The database timed out running your query." render :template => "static/error", :status => 500 elsif exception.is_a?(::ActiveRecord::RecordNotFound) - @exception = nil @error_message = "That record was not found" render :template => "static/error", :status => 404 else diff --git a/app/views/static/error.html.erb b/app/views/static/error.html.erb index e2aebe784..60e169309 100644 --- a/app/views/static/error.html.erb +++ b/app/views/static/error.html.erb @@ -6,6 +6,8 @@
  • <%= b %>
  • <%- end -%> +<% elsif @error_message %> +

    <%= @error_message %>

    <% else %>

    <%= @exception.message %>

    <% end %>