Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

filter_chain: don't try to filter nil files #120

Merged
merged 1 commit into from
Sep 9, 2016
Merged

Conversation

kyrylo
Copy link
Contributor

@kyrylo kyrylo commented Sep 9, 2016

Fixes #117 (undefined method `sub!' for nil:NilClass)

The problem can be reproduced when airbrake-ruby tries to send an
exception with a backtrace, which couldn't be parsed. In that case we
put the whole frame into function, leaving line and file nil.

@@ -13,7 +13,8 @@ class FilterChain
notice[:errors].each do |error|
Gem.path.each do |gem_path|
error[:backtrace].each do |frame|
frame[:file].sub!(/\A#{gem_path}/, '[GEM_ROOT]'.freeze)
next unless (file = frame[:file])

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice to have a comment here repeating what you said in PR description "when airbrake-ruby tries to send an exception with a backtrace, which couldn't be parsed. In that case we put the whole frame into function, leaving line and file nil."

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added.

@vmihailenco
Copy link

LGTM

Fixes #117 (undefined method `sub!' for nil:NilClass)

The problem can be reproduced when airbrake-ruby tries to send an
exception with a backtrace, which couldn't be parsed. In that case we
put the whole frame into `function`, leaving `line` and `file` nil.
@kyrylo kyrylo merged commit 8705f98 into master Sep 9, 2016
@kyrylo kyrylo deleted the 117-undefined-sub branch September 9, 2016 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants