Module: Airbrake::Backtrace Private
- Extended by:
- Loggable
- 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.
Represents a cross-Ruby backtrace from exceptions (including JRuby Java exceptions). Provides information about stack frames (such as line number, file and method) in convenient for Airbrake format.
Defined Under Namespace
Modules: Patterns
Constant Summary collapse
- CODE_FRAME_LIMIT =
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 how many first frames should include code hunks.
10
Class Method Summary collapse
-
.java_exception?(exception) ⇒ Boolean
private
Checks whether the given exception was generated by JRuby’s VM.
-
.parse(exception) ⇒ Array<Hash{Symbol=>String,Integer}>
private
Parses an exception’s backtrace.
Methods included from Loggable
Class Method Details
.java_exception?(exception) ⇒ Boolean
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.
Checks whether the given exception was generated by JRuby’s VM.
106 107 108 109 110 111 112 113 114 115 |
# File 'lib/airbrake-ruby/backtrace.rb', line 106 def self.java_exception?(exception) if defined?(Java::JavaLang::Throwable) && exception.is_a?(Java::JavaLang::Throwable) return true end return false unless exception.respond_to?(:backtrace) (Patterns::JAVA =~ exception.backtrace.first) != nil end |
.parse(exception) ⇒ Array<Hash{Symbol=>String,Integer}>
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.
Parses an exception’s backtrace.
96 97 98 99 100 |
# File 'lib/airbrake-ruby/backtrace.rb', line 96 def self.parse(exception) return [] if exception.backtrace.nil? || exception.backtrace.none? parse_backtrace(exception) end |