diff options
author | francis <francis> | 2008-01-22 17:59:50 +0000 |
---|---|---|
committer | francis <francis> | 2008-01-22 17:59:50 +0000 |
commit | 9fcb41f57d9a88d3e3fcde66dc74bbba7e452ef6 (patch) | |
tree | 3a5f18baf3d1f01704e1d5e5a69f881ebaf692ec /app/controllers/application.rb | |
parent | ea164e30e274dc712820e9ece6e9a50d5b52ef45 (diff) |
Instead of Rails, we grab all exceptions, and show formatted 404 error with
exception class.
Diffstat (limited to 'app/controllers/application.rb')
-rw-r--r-- | app/controllers/application.rb | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/app/controllers/application.rb b/app/controllers/application.rb index e01f264a2..23b6e376b 100644 --- a/app/controllers/application.rb +++ b/app/controllers/application.rb @@ -6,7 +6,7 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: application.rb,v 1.26 2008-01-09 19:56:01 francis Exp $ +# $Id: application.rb,v 1.27 2008-01-22 17:59:50 francis Exp $ class ApplicationController < ActionController::Base @@ -16,6 +16,18 @@ class ApplicationController < ActionController::Base # Pick a unique cookie name to distinguish our session data from others' session :session_key => '_foi_session_id' + # Override default error handler + def rescue_action_in_public(exception) + # do something based on exception + @exception_backtrace = exception.backtrace.join("\n") + @exception_class = exception.class.to_s + render :template => "general/exception_caught.rhtml", :status => 404 + end + + def local_request? + false + end + private # Check the user is logged in |