BaseSecrete / rorvswild

Performances & exceptions monitoring for Ruby on Rails applications
https://www.rorvswild.com
MIT License
331 stars 9 forks source link

undefined method sub for nil:NilClass #7

Closed alexbel closed 6 years ago

alexbel commented 6 years ago

ruby 2.3.0 rails 4.2.8 rorvswild 1.3.2

Airbrake cought this error:

Message   undefined method `sub' for nil:NilClass
URL   http://subdomain.example.com/api/resource
File      /gems/rorvswild-1.3.2/lib/rorvswild/location.rb:48

Backtrace (rorvswild related)

/gems/rorvswild-1.3.2/lib/rorvswild/location.rb:48 in relative_path
/gems/rorvswild-1.3.2/lib/rorvswild/location.rb:28 in extract_most_relevant_file_and_line_from_array_of_strings
/gems/rorvswild-1.3.2/lib/rorvswild/location.rb:19 in extract_most_relevant_file_and_line_from_exception
/gems/rorvswild-1.3.2/lib/rorvswild/agent.rb:169 in exception_to_hash
/gems/rorvswild-1.3.2/lib/rorvswild/agent.rb:119 in push_exception
/gems/rorvswild-1.3.2/lib/rorvswild/plugin/action_controller.rb:14 in after_exception
/gems/rorvswild-1.3.2/lib/rorvswild/plugin/action_controller.rb:9 in block in setup
alexisbernard commented 6 years ago

Thanks for the report. However I didn't succeed to reproduce it. I suspect the original exception has an empty backtrace but that does not make any sense. Are you able to reproduce the error easily?

alexisbernard commented 6 years ago

I found a way to reproduce by calling exception.set_backtrace([]) which is a weird case. Update your Gemfile gem "rorvswild", "~> 1.3.4" it's fixed :-)

alexbel commented 6 years ago

@alexisbernard Thanks! :+1: