Class: StackifyRubyAPM::Spies::ActionDispatchSpy Private

Inherits:
Object
  • Object
show all
Defined in:
lib/stackify_apm/spies/action_dispatch.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Instance Method Details

#installObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/stackify_apm/spies/action_dispatch.rb', line 10

def install
  ::ActionDispatch::ShowExceptions.class_eval do
    alias_method 'render_exception_without_apm', 'render_exception'

    def render_exception(request, exception, *args)
      # Creates exception log report
      #
      begin
        StackifyRubyAPM.report(exception)
      rescue Exception => e
        StackifyRubyAPM.agent.error '[ActionDispatchSpy] Error: repoting exception.'
        StackifyRubyAPM.agent.error "[ActionDispatchSpy] #{e.inspect}"
      end

      self.send(:render_exception_without_apm, request, exception, *args);
    end
  end
end