Class: StackifyRubyAPM::Spies::ActionDispatchDebugExceptionsSpy 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.



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/stackify_apm/spies/action_dispatch.rb', line 31

def install
  ::ActionDispatch::DebugExceptions.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 '[ActionDispatchDebugExceptionsSpy] Error: repoting exception.'
        StackifyRubyAPM.agent.error "[ActionDispatchDebugExceptionsSpy] #{e.inspect}"
      end

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