Class: Hoss::Error Private

Inherits:
Object
  • Object
show all
Defined in:
lib/hoss/error.rb,
lib/hoss/error/log.rb,
lib/hoss/error/exception.rb

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

Defined Under Namespace

Classes: Exception, Log

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(culprit: nil, context: nil) ⇒ Error

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.

Returns a new instance of Error.



28
29
30
31
32
33
# File 'lib/hoss/error.rb', line 28

def initialize(culprit: nil, context: nil)
  @id = SecureRandom.hex(16)
  @culprit = culprit
  @timestamp = Util.micros
  @context = context
end

Instance Attribute Details

#contextObject

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.



35
36
37
# File 'lib/hoss/error.rb', line 35

def context
  @context
end

#culpritObject

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.



35
36
37
# File 'lib/hoss/error.rb', line 35

def culprit
  @culprit
end

#exceptionObject

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.



35
36
37
# File 'lib/hoss/error.rb', line 35

def exception
  @exception
end

#idObject

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.



35
36
37
# File 'lib/hoss/error.rb', line 35

def id
  @id
end

#logObject

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.



35
36
37
# File 'lib/hoss/error.rb', line 35

def log
  @log
end

#parent_idObject

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.



35
36
37
# File 'lib/hoss/error.rb', line 35

def parent_id
  @parent_id
end

#timestampObject (readonly)

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.



37
38
39
# File 'lib/hoss/error.rb', line 37

def timestamp
  @timestamp
end

#trace_idObject

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.



35
36
37
# File 'lib/hoss/error.rb', line 35

def trace_id
  @trace_id
end

#transactionObject

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.



35
36
37
# File 'lib/hoss/error.rb', line 35

def transaction
  @transaction
end

#transaction_idObject

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.



35
36
37
# File 'lib/hoss/error.rb', line 35

def transaction_id
  @transaction_id
end

Instance Method Details

#inspectObject

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.



39
40
41
42
43
44
45
46
47
# File 'lib/hoss/error.rb', line 39

def inspect
  "<Hoss::Error id:#{id}" \
    " culprit:#{culprit}" \
    " timestamp:#{timestamp}" \
    " transaction_id:#{transaction_id}" \
    " trace_id:#{trace_id}" \
    " exception:#{exception.inspect}" \
    '>'
end