Sha256: 0c17168099eff3eca1221bc0a408b4719711b6ebcf8b25ac84f4b5e48986e0c7

Contents?: true

Size: 851 Bytes

Versions: 27

Compression:

Stored size: 851 Bytes

Contents

# This class encapsulates an error that was noticed by New Relic in a managed app.
class NewRelic::NoticedError
  extend NewRelic::CollectionHelper
  attr_accessor :path, :timestamp, :params, :exception_class, :message

  def initialize(path, data, exception, timestamp = Time.now)
    self.path = path
    self.params = NewRelic::NoticedError.normalize_params(data)

    self.exception_class = exception.is_a?(Exception) ? exception.class.name : 'Error'

    if exception.respond_to?('original_exception')
      self.message = exception.original_exception.message.to_s
    else
      self.message = (exception || '<no message>').to_s
    end

    # clamp long messages to 4k so that we don't send a lot of
    # overhead across the wire
    self.message = self.message[0..4095] if self.message.length > 4096

    self.timestamp = timestamp
  end
end

Version data entries

27 entries across 27 versions & 3 rubygems

Version Path
dolores_rpm-3.2.0.6 lib/new_relic/noticed_error.rb
dolores_rpm-3.2.0.5 lib/new_relic/noticed_error.rb
dolores_rpm-3.2.0.4 lib/new_relic/noticed_error.rb
dolores_rpm-3.2.0.3 lib/new_relic/noticed_error.rb
dolores_rpm-3.2.0.2 lib/new_relic/noticed_error.rb
newrelic_rpm-3.3.1.beta1 lib/new_relic/noticed_error.rb
newrelic_rpm-3.3.0 lib/new_relic/noticed_error.rb
newrelic_rpm-3.3.0.beta1 lib/new_relic/noticed_error.rb
newrelic_rpm-3.2.0.1 lib/new_relic/noticed_error.rb
newrelic_rpm-3.2.0 lib/new_relic/noticed_error.rb
newrelic_rpm-3.2.0.beta2 lib/new_relic/noticed_error.rb
newrelic_rpm-3.2.0.beta1 lib/new_relic/noticed_error.rb
newrelic_rpm-3.1.2 lib/new_relic/noticed_error.rb
newrelic_rpm-3.1.2.beta2 lib/new_relic/noticed_error.rb
newrelic_rpm-3.1.2.beta1 lib/new_relic/noticed_error.rb
newrelic_rpm-3.1.1 lib/new_relic/noticed_error.rb
newrelic_rpm-3.1.1.beta3 lib/new_relic/noticed_error.rb
newrelic_rpm-3.1.1.beta2 lib/new_relic/noticed_error.rb
newrelic_rpm-3.1.1.beta1 lib/new_relic/noticed_error.rb
ghazel-newrelic_rpm-3.1.0.1 lib/new_relic/noticed_error.rb