Method: Hoss::ErrorBuilder#build_log

Defined in:
lib/hoss/error_builder.rb

#build_log(message, context: nil, backtrace: nil, **attrs) ⇒ 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.



43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/hoss/error_builder.rb', line 43

def build_log(message, context: nil, backtrace: nil, **attrs)
  error = Error.new context: context || Context.new
  error.log = Error::Log.new(message, **attrs)

  if backtrace
    add_stacktrace error, :log, backtrace
  end

  add_current_transaction_fields error, Hoss.current_transaction

  error
end