Method: Datadog::Span#set_error

Defined in:
lib/ddtrace/span.rb

#set_error(e) ⇒ Object

Mark the span with the given error.



67
68
69
70
71
72
73
# File 'lib/ddtrace/span.rb', line 67

def set_error(e)
  return if e.nil?
  @status = 1
  @meta[Datadog::Ext::Errors::MSG] = e.message if e.respond_to?(:message) && e.message
  @meta[Datadog::Ext::Errors::TYPE] = e.class.to_s
  @meta[Datadog::Ext::Errors::STACK] = e.backtrace.join("\n") if e.respond_to?(:backtrace) && e.backtrace
end