Skip to content
Browse files

obey deprecated Exception from rails-3.2.9

  • Loading branch information...
1 parent 255d041 commit 83d727fc0933ced4a6fbdd90e70e46d8eba6b79d @mkristian committed Dec 18, 2012
Showing with 10 additions and 3 deletions.
  1. +0 −2 ixtlan-error-handler.gemspec.files
  2. +10 −1 lib/ixtlan/errors/rescue_module.rb
View
2 ixtlan-error-handler.gemspec.files
@@ -1,2 +0,0 @@
-ixtlan-error-handler.gemspec
-Mavenfile
View
11 lib/ixtlan/errors/rescue_module.rb
@@ -6,6 +6,10 @@ def self.included(controller)
# needs 'optimistic_persistence'
controller.rescue_from ::Ixtlan::ModifiedBy::StaleResourceError, :with => :stale_resource
end
+ if defined? ::Ixtlan::Optimistic
+ # needs 'optimistic_persistence'
+ controller.rescue_from ::Ixtlan::Optimistic::ObjectStaleException, :with => :stale_resource
+ end
if defined? ::Ixtlan::Guard
# needs 'guard'
@@ -25,7 +29,12 @@ def self.included(controller)
# standard rails controller
controller.rescue_from ::ActionController::RoutingError, :with => :page_not_found
- controller.rescue_from ::ActionController::UnknownAction, :with => :page_not_found
+
+ if defined? ::AbstractController::ActionNotFound
+ controller.rescue_from ::AbstractController::ActionNotFound, :with => :page_not_found
+ else
+ controller.rescue_from ::ActionController::UnknownAction, :with => :page_not_found
+ end
controller.rescue_from ::ActionController::MethodNotAllowed, :with => :page_not_found
controller.rescue_from ::ActionController::NotImplemented, :with => :page_not_found
controller.rescue_from ::ActionController::InvalidAuthenticityToken, :with => :stale_resource

0 comments on commit 83d727f

Please sign in to comment.
Something went wrong with that request. Please try again.