diff options
Diffstat (limited to 'app/controllers/application_controller.rb')
-rw-r--r-- | app/controllers/application_controller.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index d062519bc..7c9585955 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -121,6 +121,14 @@ class ApplicationController < ActionController::Base @exception_class = exception.class.to_s @exception_message = exception.message status_code = case exception + when ActiveRecord::RecordNotFound, + ActionController::UnknownAction + 404 + when PermissionDenied + 403 + else + 500 + end render :template => "general/exception_caught", :status => status_code end |