Sha256: 1cd80a092c5ab6b2677b8fe87a29102ff7bc6459d9538ebcb468a070593dc6a6

Contents?: true

Size: 921 Bytes

Versions: 4

Compression:

Stored size: 921 Bytes

Contents

ActionController::Base.class_eval do
  
  # Make a note of an exception associated with the currently executin
  # controller action.  Note that this used to be available on Object
  # but we replaced that global method with NewRelic::Agent#notice_error.
  # Use that one outside of controller actions.
  def newrelic_notice_error(exception, custom_params = {})
    NewRelic::Agent::Instrumentation::MetricFrame.notice_error exception, custom_params
  end
  
  def rescue_action_with_newrelic_trace(exception)
    NewRelic::Agent::Instrumentation::MetricFrame.notice_error exception
    rescue_action_without_newrelic_trace exception
  end
  
  # Compare with #alias_method_chain, which is not available in 
  # Rails 1.1:
  alias_method :rescue_action_without_newrelic_trace, :rescue_action
  alias_method :rescue_action, :rescue_action_with_newrelic_trace
  protected :rescue_action

end if defined? ActionController

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
newrelic_rpm-2.10.5 lib/new_relic/agent/instrumentation/rails/errors.rb
newrelic_rpm-2.10.4 lib/new_relic/agent/instrumentation/rails/errors.rb
newrelic_rpm-2.10.3 lib/new_relic/agent/instrumentation/rails/errors.rb
factorylabs-newrelic_rpm-2.10.2.2 lib/new_relic/agent/instrumentation/rails/errors.rb