lib/airbrake/rails/error_lookup.rb in airbrake-3.1.6 vs lib/airbrake/rails/error_lookup.rb in airbrake-3.1.7

- old
+ new

@@ -2,11 +2,13 @@ module Rails module ErrorLookup # Sets up an alias chain to catch exceptions when Rails does def self.included(base) #:nodoc: - base.send(:alias_method, :rescue_action_locally_without_airbrake, :rescue_action_locally) - base.send(:alias_method, :rescue_action_locally, :rescue_action_locally_with_airbrake) + if base.method_defined?(:rescue_action_locally) + base.send(:alias_method, :rescue_action_locally_without_airbrake, :rescue_action_locally) + base.send(:alias_method, :rescue_action_locally, :rescue_action_locally_with_airbrake) + end end private def rescue_action_locally_with_airbrake(exception)