# File lib/new_relic/agent/stats_engine/stats_hash.rb, line 122 def handle_stats_lookup_error(key, hash, error) # This only happen in the case of a corrupted default_proc # Side-step it manually, notice the issue, and carry on.... NewRelic::Agent.instance.error_collector. \ notice_agent_error(StatsHashLookupError.new(error, hash, key)) stats = NewRelic::Agent::Stats.new hash[key] = stats # Try to restore the default_proc so we won't continually trip the error if hash.respond_to?(:default_proc=) hash.default_proc = Proc.new { |h, k| h[k] = NewRelic::Agent::Stats.new } end stats end