module TingYun::Agent::Collector::ErrorCollector::Tag

tag the exception,avoid the same exception record multiple times in the middlwars and other point

Constants

EXCEPTION_TAG_IVAR

Public Instance Methods

exception_tagged?(exception) click to toggle source
# File lib/ting_yun/agent/collector/error_collector.rb, line 41
def exception_tagged?(exception)
  exception.instance_variable_defined?(EXCEPTION_TAG_IVAR)
end
tag_exception(exception) click to toggle source
# File lib/ting_yun/agent/collector/error_collector.rb, line 33
def tag_exception(exception)
  begin
    exception.instance_variable_set(EXCEPTION_TAG_IVAR, true)
  rescue => e
    TingYun::Agent.logger.warn("Failed to tag exception: #{exception}: ", e)
  end
end