Sha256: ed9d1ea1759e627811257e574071ef133a7a58dc7496200f92b9b6614abeee27

Contents?: true

Size: 729 Bytes

Versions: 4

Compression:

Stored size: 729 Bytes

Contents

DependencyDetection.defer do
  depends_on do
    defined?(Merb) && defined?(Merb::Dispatcher) && defined?(Merb::Dispatcher::DefaultException)
  end

  depends_on do
    Merb::Dispatcher::DefaultException.respond_to?(:before)
  end

  executes do

    # Hook in the notification to merb
    error_notifier = Proc.new {
      if request.exceptions #check that there's actually an exception
        # Note, this assumes we have already captured the other information such as uri and params in the MetricFrame.
        NewRelic::Agent::Instrumentation::MetricFrame.notice_error(request.exceptions.first)
      end
    }
    Merb::Dispatcher::DefaultException.before error_notifier
    Exceptions.before error_notifier
    
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
newrelic_rpm-2.14.1.logging1 lib/new_relic/agent/instrumentation/merb/errors.rb
newrelic_rpm-2.14.1 lib/new_relic/agent/instrumentation/merb/errors.rb
newrelic_rpm-2.14.0 lib/new_relic/agent/instrumentation/merb/errors.rb
newrelic_rpm-2.13.6.beta2 lib/new_relic/agent/instrumentation/merb/errors.rb