Method: Hoss::ErrorBuilder#build_exception

Defined in:
lib/hoss/error_builder.rb

#build_exception(exception, context: nil, handled: true) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/hoss/error_builder.rb', line 27

def build_exception(exception, context: nil, handled: true)
  error = Error.new context: context || Context.new
  error.exception =
    Error::Exception.from_exception(exception, handled: handled)

  Util.reverse_merge!(error.context.labels, @agent.config.default_labels)

  if exception.backtrace
    add_stacktrace error, :exception, exception.backtrace
  end

  add_current_transaction_fields error, Hoss.current_transaction

  error
end