class Aquarium::Aspects::AfterRaisingAdviceChainNode

Note that the advice is not invoked if the exception is not of a type specified when the advice was created. However, the default is to advise all thrown objects.

Public Class Methods

new(options = {}) click to toggle source
# File lib/aquarium/aspects/advice.rb, line 200
def initialize options = {}
  super options
end

Public Instance Methods

advice_wrapper(jp) click to toggle source
# File lib/aquarium/aspects/advice.rb, line 203
def advice_wrapper jp
  begin
    next_node.call jp
  rescue Object => raised_exception
    if after_raising_exceptions_list_includes raised_exception
      update_current_context jp
      jp.context.advice_kind = :after_raising
      jp.context.raised_exception = raised_exception
      call_advice jp
      raised_exception = jp.context.raised_exception   # allow advice to modify the raised exception
      reset_current_context jp
    end
    raise raised_exception
  end
end