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

Undefined method `report_exception' when rescuing for Sidekiq::VERSION < '3' #181

Closed
SyntheticDave opened this issue Nov 24, 2014 · 4 comments

Comments

@SyntheticDave
Copy link

Having updated to the latest gem version to get rid of the report_exception deprecation warning, I'm now getting a no method error when raising from a sidekiq worker.

lib/rollbar/sidekiq.rb:15:in `rescue in call'
NoMethodError: undefined method 'report_exception' for #<Rollbar::Notifier:0x007f8ee23ddc40>

This occurs with the rollbar gem at 1.2.9, and sidekiq at 2.17.0.

@brianr
Copy link
Member

brianr commented Nov 24, 2014

Thanks for the report @SyntheticDave . I think the following diff will fix it if you want to apply a hotfix:

diff --git a/lib/rollbar/sidekiq.rb b/lib/rollbar/sidekiq.rb
index 3f571fa..72c727e 100644
--- a/lib/rollbar/sidekiq.rb
+++ b/lib/rollbar/sidekiq.rb
@@ -12,7 +12,7 @@ if Sidekiq::VERSION < '3'
           params = msg.reject{ |k| PARAM_BLACKLIST.include?(k) }
           scope = { :request => { :params => params } }

-          Rollbar.scope(scope).report_exception(e)
+          Rollbar.scope(scope).error(e)
           raise
         end
       end

Will get this pushed as a new release shortly.

@brianr brianr closed this as completed in 5df43ac Nov 24, 2014
@brianr
Copy link
Member

brianr commented Nov 24, 2014

Pushed the fix in v1.2.10 (now up on rubygems). Thanks again for reporting this.

@SyntheticDave
Copy link
Author

No problem. Thanks for the really quick fix.

@ajsharp
Copy link

ajsharp commented Nov 27, 2014

Cheers to you guys for being ON IT. #rollbar4Lyfe ❤️ ❤️ ❤️

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

No branches or pull requests

3 participants