Giter Site home page Giter Site logo

Comments (2)

bangrrrt avatar bangrrrt commented on June 30, 2024

Rails 7.0.6
Rollbar 3.4.0
jruby 9.4.3.0
ruby 3.1.4

We experienced the same thing. We can't create a minimal example to reproduce the issue but we got around it with this patch.

Rollbar::Notifier.class_eval do
  def use_exception_level_filters?(options)
    option_value = options && options[:use_exception_level_filters]

    return option_value unless option_value.nil?

    configuration.use_exception_level_filters_default
  end
end

The difference is options[:use_exception_level_filters] vs options.delete(:use_exception_level_filters)

https://github.com/rollbar/rollbar-gem/blob/master/lib/rollbar/notifier.rb#L409


These args are passed to Rollbar.log. At this point extra is a hash.

[1] pry(#<Rollbar::Notifier>)> extra
=> {:use_exception_level_filters=>true}
[2] pry(#<Rollbar::Notifier>)> extra.class
=> Hash

After use_exception_level_filters? is called extra returns a weird error.

[1] pry(#<Rollbar::Notifier>)> extra
ArgumentError: wrong number of arguments (given 0, expected 1)
from /usr/local/rvm/gems/default/gems/pry-0.14.2-java/lib/pry/ring.rb:43:in `<<'
Caused by RuntimeError: foo
from /workspaces/Profile/app/controllers/name_controller.rb:8:in `edit'
[2] pry(#<Rollbar::Notifier>)> extra.class
=> Hash

When ignore_before_process? is called it's with extra it produces this error.

[1] pry(#<Rollbar::Notifier>)> ignore_before_process?(level, exception, message, extra)
ArgumentError: wrong number of arguments (given 3, expected 4)
from /usr/local/rvm/gems/default/gems/rollbar-3.4.0/lib/rollbar/notifier.rb:158:in `ignore_before_process?'
Caused by RuntimeError: foobar
from /workspaces/Profile/app/controllers/name_controller.rb:8:in `edit'

When plugging in the actual value all is good.

[2] pry(#<Rollbar::Notifier>)> ignore_before_process?(level, exception, message, {:use_exception_level_filters=>true})
=> false

Side note: The method use_exception_level_filters? is a bit misleading as it also mutates the options.

from rollbar-gem.

lenny avatar lenny commented on June 30, 2024

While many consider avoiding mutation of method arguments preferable, this bug appears to be rooted in a Jruby issue. I've submitted Unexpected ArgumentError calling Forwardable delegated single splat method with keyword arguments

from rollbar-gem.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.