Method: TingYun::Instrumentation::Support::ExternalError.set_attributes

Defined in:
lib/ting_yun/instrumentation/support/external_error.rb

.set_attributes(exception, klass, code) ⇒ Object



43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/ting_yun/instrumentation/support/external_error.rb', line 43

def set_attributes(exception, klass, code)
  exception.instance_exec {extend TingYun::Instrumentation::Support::Variables}
  begin
    exception.tingyun_code = code
    exception.tingyun_klass = klass
    exception.tingyun_external = true
    trace = caller.reject! { |t| t.include?('tingyun_rpm') }
    trace = trace.first(20)
    exception.tingyun_trace = trace
  rescue => e
    TingYun::Agent.logger.warn("Failed to set attributes for : #{exception}: ", e)
  end
end