Module: Airbrake::Backtrace::Patterns Private

Defined in:
lib/airbrake-ruby/backtrace.rb

Overview

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

Since:

  • v1.0.0

Constant Summary collapse

RUBY =

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

Returns the pattern that matches standard Ruby stack frames, such as ./spec/notice_spec.rb:43:in ‘block (3 levels) in <top (required)>’.

Returns:

  • (Regexp)

    the pattern that matches standard Ruby stack frames, such as ./spec/notice_spec.rb:43:in ‘block (3 levels) in <top (required)>’

Since:

  • v1.0.0

%r{\A
  (?<file>.+)       # Matches './spec/notice_spec.rb'
  :
  (?<line>\d+)      # Matches '43'
  :in\s
  `(?<function>.*)' # Matches "`block (3 levels) in <top (required)>'"
\z}x.freeze
JAVA =

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

Returns the pattern that matches JRuby Java stack frames, such as org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105).

Returns:

  • (Regexp)

    the pattern that matches JRuby Java stack frames, such as org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)

Since:

  • v1.0.0

%r{\A
  (?<function>.+)  # Matches 'org.jruby.ast.NewlineNode.interpret'
  \(
    (?<file>
      (?:uri:classloader:/.+(?=:)) # Matches '/META-INF/jruby.home/protocol.rb'
      |
      (?:uri_3a_classloader_3a_.+(?=:)) # Matches 'uri_3a_classloader_3a_/gems/...'
      |
      [^:]+        # Matches 'NewlineNode.java'
    )
    :?
    (?<line>\d+)?  # Matches '105'
  \)
\z}x.freeze
GENERIC =

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

Returns the pattern that tries to assume what a generic stack frame might look like, when exception’s backtrace is set manually.

Returns:

  • (Regexp)

    the pattern that tries to assume what a generic stack frame might look like, when exception’s backtrace is set manually.

Since:

  • v1.0.0

%r{\A
  (?:from\s)?
  (?<file>.+)              # Matches '/foo/bar/baz.ext'
  :
  (?<line>\d+)?            # Matches '43' or nothing
  (?:
    in\s`(?<function>.+)'  # Matches "in `func'"
  |
    :in\s(?<function>.+)   # Matches ":in func"
  )?                       # ... or nothing
\z}x.freeze
OCI =

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

Note:

This is raised by github.com/kubo/ruby-oci8

Returns the pattern that matches exceptions from PL/SQL such as ORA-06512: at “STORE.LI_LICENSES_PACK”, line 1945.

Returns:

  • (Regexp)

    the pattern that matches exceptions from PL/SQL such as ORA-06512: at “STORE.LI_LICENSES_PACK”, line 1945

Since:

  • v1.0.0

/\A
  (?:
    ORA-\d{5}
    :\sat\s
    (?:"(?<function>.+)",\s)?
    line\s(?<line>\d+)
  |
    #{GENERIC}
  )
\z/x.freeze
EXECJS =

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

Returns the pattern that matches CoffeeScript backtraces usually coming from Rails & ExecJS.

Returns:

  • (Regexp)

    the pattern that matches CoffeeScript backtraces usually coming from Rails & ExecJS

Since:

  • v1.0.0

/\A
  (?:
    # Matches 'compile ((execjs):6692:19)'
    (?<function>.+)\s\((?<file>.+):(?<line>\d+):\d+\)
  |
    # Matches 'bootstrap_node.js:467:3'
    (?<file>.+):(?<line>\d+):\d+(?<function>)
  |
    # Matches the Ruby part of the backtrace
    #{RUBY}
  )
\z/x.freeze