Class: Gruf::Errors::DebugInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/gruf/errors/debug_info.rb

Overview

Represents debugging information for an exception that occurred in a gRPC service

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(detail, stack_trace = []) ⇒ DebugInfo



32
33
34
35
# File 'lib/gruf/errors/debug_info.rb', line 32

def initialize(detail, stack_trace = [])
  @detail = detail
  @stack_trace = stack_trace.is_a?(String) ? stack_trace.split("\n") : stack_trace
end

Instance Attribute Details

#detailString (readonly)



24
25
26
# File 'lib/gruf/errors/debug_info.rb', line 24

def detail
  @detail
end

#stack_traceArray<String> (readonly)



26
27
28
# File 'lib/gruf/errors/debug_info.rb', line 26

def stack_trace
  @stack_trace
end

Instance Method Details

#to_hHash

Return this object marshalled into a hash



42
43
44
45
46
47
# File 'lib/gruf/errors/debug_info.rb', line 42

def to_h
  {
    detail: detail,
    stack_trace: stack_trace
  }
end