diff options
author | Seb Bacon <seb.bacon@gmail.com> | 2011-08-30 14:57:37 +0100 |
---|---|---|
committer | Seb Bacon <seb.bacon@gmail.com> | 2011-08-30 14:57:37 +0100 |
commit | 1ae1a120ae5b034ba9efc0f433224fe993a61920 (patch) | |
tree | a3a4250c5af1e29e6e101e7906e96479d12bcff7 /app/controllers/application_controller.rb | |
parent | a8d0c217e68fdac0331c0d80df511e5340a67fb7 (diff) | |
parent | 0420098e50996a033552335e94e35ade781357af (diff) |
Merge branch 'develop' into feature/add-recaptcha
Diffstat (limited to 'app/controllers/application_controller.rb')
-rw-r--r-- | app/controllers/application_controller.rb | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index cae3cb213..6d14d0d7a 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -8,6 +8,7 @@ # # $Id: application.rb,v 1.59 2009-09-17 13:01:56 francis Exp $ +require 'open-uri' class ApplicationController < ActionController::Base # Standard headers, footers and navigation for whole site @@ -101,11 +102,17 @@ class ApplicationController < ActionController::Base # Make sure expiry time for session is set (before_filters are # otherwise missed by this override) session_remember_me - + case exception + when ActiveRecord::RecordNotFound, ActionController::UnknownAction, ActionController::RoutingError + @status = 404 + else + @status = 500 + end # Display user appropriate error message @exception_backtrace = exception.backtrace.join("\n") @exception_class = exception.class.to_s - render :template => "general/exception_caught.rhtml", :status => 404 + @exception_message = exception.message + render :template => "general/exception_caught.rhtml", :status => @status end # For development sites. |