Class: CircuitSwitch::StacktraceModifier

Inherits:
Object
  • Object
show all
Defined in:
lib/circuit_switch/stacktrace_modifier.rb

Class Method Summary collapse

Class Method Details

.call(backtrace:) ⇒ Object



8
9
10
11
12
13
14
15
16
17
# File 'lib/circuit_switch/stacktrace_modifier.rb', line 8

def call(backtrace:)
  if config.with_backtrace
    backtrace
      .select { |path| /(#{config.allowed_backtrace_paths.join('|')})/.match?(path) }
      .map { |path| path.sub(/(#{config.strip_paths.join('|')})/, '') }
  else
    backtrace
      .select { |path| /(#{config.allowed_backtrace_paths.join('|')})/.match?(path) }
  end
end