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
Calls superclass method Aquarium::Aspects::AdviceChainNode::new
    # File lib/aquarium/aspects/advice.rb
202 def initialize options = {}
203   super options
204 end

Public Instance Methods

advice_wrapper(jp) click to toggle source
    # File lib/aquarium/aspects/advice.rb
205 def advice_wrapper jp
206   begin
207     next_node.call jp
208   rescue Object => raised_exception
209     if after_raising_exceptions_list_includes raised_exception
210       update_current_context jp
211       jp.context.advice_kind = :after_raising
212       jp.context.raised_exception = raised_exception
213       call_advice jp
214       raised_exception = jp.context.raised_exception   # allow advice to modify the raised exception
215       reset_current_context jp
216     end
217     raise raised_exception
218   end
219 end