diff options
author | Louise Crow <louise.crow@gmail.com> | 2013-05-02 10:29:39 +0100 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2013-05-02 13:29:30 +0100 |
commit | 106bbf1976406b9bb212944131758d797f516682 (patch) | |
tree | 3cf7a2f99c7c3c21ce3ae29aeb299fc1eb46a24c /app/controllers/application_controller.rb | |
parent | 6acce073443fbd700f346b1bf99ee72be3e4f387 (diff) |
Handle routing errors with our custom template too.
Diffstat (limited to 'app/controllers/application_controller.rb')
-rw-r--r-- | app/controllers/application_controller.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index b8bdc403c..62479f200 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -12,6 +12,8 @@ require 'open-uri' class ApplicationController < ActionController::Base class PermissionDenied < StandardError end + class RouteNotFound < StandardError + end # assign our own handler method for non-local exceptions rescue_from Exception, :with => :render_exception @@ -128,7 +130,7 @@ class ApplicationController < ActionController::Base @exception_class = exception.class.to_s @exception_message = exception.message case exception - when ActiveRecord::RecordNotFound + when ActiveRecord::RecordNotFound, RouteNotFound @status = 404 when PermissionDenied @status = 403 @@ -173,6 +175,7 @@ class ApplicationController < ActionController::Base render :template => "general/exception_caught", :status => @status end + # FIXME: This was disabled during the Rails 3 upgrade as this is now handled by Rack # # For development sites. # alias original_rescue_action_locally rescue_action_locally |