Skip to content

Commit

Permalink
Merge pull request #140 from airbrake/139-jruby-frame-fix
Browse files Browse the repository at this point in the history
backtrace: special case classloader path
  • Loading branch information
kyrylo authored Dec 15, 2016
2 parents 4e75bcd + 1c3db60 commit ecf9d61
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ Airbrake Ruby Changelog

### master

* Improved JRuby parsing of frames which include classloader
([#140](https://github.com/airbrake/airbrake-ruby/pull/140))

### [v1.6.0][v1.6.0] (October 18, 2016)

* Added support for blacklisting/whitelisting using procs
Expand Down
2 changes: 2 additions & 0 deletions lib/airbrake-ruby/backtrace.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ module Patterns
(?<file>
(?:uri:classloader:/.+(?=:)) # Matches '/META-INF/jruby.home/protocol.rb'
|
(?:uri_3a_classloader_3a_.+(?=:)) # Matches 'uri_3a_classloader_3a_/gems/...'
|
[^:]+ # Matches 'NewlineNode.java'
)
:?
Expand Down
8 changes: 6 additions & 2 deletions spec/backtrace_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,18 @@
let(:backtrace) do
# rubocop:disable Metrics/LineLength
['uri_3a_classloader_3a_.META_minus_INF.jruby_dot_home.lib.ruby.stdlib.net.protocol.rbuf_fill(uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/net/protocol.rb:158)',
'bin.processors.image_uploader.block in make_streams(bin/processors/image_uploader.rb:21)']
'bin.processors.image_uploader.block in make_streams(bin/processors/image_uploader.rb:21)',
'uri_3a_classloader_3a_.gems.faye_minus_websocket_minus_0_dot_10_dot_5.lib.faye.websocket.api.invokeOther13:dispatch_event(uri_3a_classloader_3a_/gems/faye_minus_websocket_minus_0_dot_10_dot_5/lib/faye/websocket/uri:classloader:/gems/faye-websocket-0.10.5/lib/faye/websocket/api.rb:109)',
'tmp.jruby9022301782566983632extract.$dot.META_minus_INF.rails.file(/tmp/jruby9022301782566983632extract/./META-INF/rails.rb:13)']
# rubocop:enable Metrics/LineLength
end

let(:parsed_backtrace) do
# rubocop:disable Metrics/LineLength
[{ file: 'uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/net/protocol.rb', line: 158, function: 'uri_3a_classloader_3a_.META_minus_INF.jruby_dot_home.lib.ruby.stdlib.net.protocol.rbuf_fill' },
{ file: 'bin/processors/image_uploader.rb', line: 21, function: 'bin.processors.image_uploader.block in make_streams' }]
{ file: 'bin/processors/image_uploader.rb', line: 21, function: 'bin.processors.image_uploader.block in make_streams' },
{ file: 'uri_3a_classloader_3a_/gems/faye_minus_websocket_minus_0_dot_10_dot_5/lib/faye/websocket/uri:classloader:/gems/faye-websocket-0.10.5/lib/faye/websocket/api.rb', line: 109, function: 'uri_3a_classloader_3a_.gems.faye_minus_websocket_minus_0_dot_10_dot_5.lib.faye.websocket.api.invokeOther13:dispatch_event' },
{ file: '/tmp/jruby9022301782566983632extract/./META-INF/rails.rb', line: 13, function: 'tmp.jruby9022301782566983632extract.$dot.META_minus_INF.rails.file' }]
# rubocop:enable Metrics/LineLength
end

Expand Down

0 comments on commit ecf9d61

Please sign in to comment.