| Class | Aquarium::Aspects::AfterRaisingAdviceChainNode |
| In: |
lib/aquarium/aspects/advice.rb
|
| Parent: | AdviceChainNode |
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.
# File lib/aquarium/aspects/advice.rb, line 186
186: def initialize options = {}
187: super options
188: end
# File lib/aquarium/aspects/advice.rb, line 189
189: def advice_wrapper jp
190: begin
191: next_node.call jp
192: rescue Object => raised_exception
193: if after_raising_exceptions_list_includes raised_exception
194: update_current_context jp
195: jp.context.advice_kind = :after_raising
196: jp.context.raised_exception = raised_exception
197: call_advice jp
198: raised_exception = jp.context.raised_exception # allow advice to modify the raised exception
199: reset_current_context jp
200: end
201: raise raised_exception
202: end
203: end