From 0c16ab4e6fc32db3c71f32b9d3250356e81a3a79 Mon Sep 17 00:00:00 2001 From: Jacques Distler Date: Sun, 30 Dec 2007 10:41:19 -0600 Subject: [PATCH] Better Error for Stale Session Rather than giving a generic 500 error, tell the user to reload the page. --- app/controllers/application.rb | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/app/controllers/application.rb b/app/controllers/application.rb index 0d1d52cc..0ba5e82b 100644 --- a/app/controllers/application.rb +++ b/app/controllers/application.rb @@ -115,13 +115,17 @@ class ApplicationController < ActionController::Base end def rescue_action_in_public(exception) - render :status => 500, :text => <<-EOL - -

Internal Error

-

An application error occurred while processing your request.

- - - EOL + if exception.instance_of?(CGI::Session::CookieStore::TamperedWithCookie) + render :text => 'Stale session. Please reload the page.', :status =>500, :layout => 'error' + else + render :status => 500, :text => <<-EOL + +

Internal Error

+

An application error occurred while processing your request.

+ + + EOL + end end def return_to_last_remembered