Module: Sqreen::Kit::StackTrace

Extended by:
Loggable
Defined in:
lib/sqreen/kit/signals/stack_trace.rb

Defined Under Namespace

Modules: Patterns

Class Method Summary collapse

Class Method Details

.parse(exception) ⇒ Array<Hash{Symbol=>String,Integer}>

Parses an exception’s backtrace.

Parameters:

  • exception (Exception)

    The exception, which contains a backtrace to parse

Returns:

  • (Array<Hash{Symbol=>String,Integer}>)

    the parsed backtrace



69
70
71
72
# File 'lib/sqreen/kit/signals/stack_trace.rb', line 69

def parse(exception)
  return [] if exception.backtrace.nil? || exception.backtrace.none?
  do_parse(exception)
end

.parse_backtrace(backtrace) ⇒ Object



74
75
76
77
78
79
# File 'lib/sqreen/kit/signals/stack_trace.rb', line 74

def parse_backtrace(backtrace)
  # assume normal ruby backtrace
  backtrace.map do |stackframe|
    stack_frame(Patterns::RUBY, stackframe)
  end
end