Better Error for Stale Session
Rather than giving a generic 500 error, tell the user to reload the page.
This commit is contained in:
parent
a2c7705de5
commit
0c16ab4e6f
1 changed files with 11 additions and 7 deletions
|
@ -115,6 +115,9 @@ class ApplicationController < ActionController::Base
|
|||
end
|
||||
|
||||
def rescue_action_in_public(exception)
|
||||
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
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><body>
|
||||
<h2>Internal Error</h2>
|
||||
|
@ -123,6 +126,7 @@ class ApplicationController < ActionController::Base
|
|||
</body></html>
|
||||
EOL
|
||||
end
|
||||
end
|
||||
|
||||
def return_to_last_remembered
|
||||
# Forget the redirect location
|
||||
|
|
Loading…
Reference in a new issue