Unable to send exception data to Raygun through the rails app and rake test task. Works through Rails Console

Binu

Posted on
Jun 14 2016

Hello,

I am unable to send exception data to Raygun through the Rails App and the Rake Test task on our staging environment. The sending of exception data works through the Rails Console though.

Raygun.rb

Raygun.setup do |config|

config.api_key = [Key]

config.filterparameters = Rails.application.config.filterparameters

# The default is Rails.env.production?

config.enable_reporting = !Rails.env.development?

end

Gemfile.lock raygun entry

raygun4ruby (1.1.9)

  httparty (~> 0.11)
  json
  rack

The error that I get when I try the rake test

$ RAILS_ENV=production rake raygun:test

Oh-oh, something went wrong - double check your API key

API Key - [FIltered])

rake aborted!

TypeError: no implicit conversion of HTTParty::Response into String

/var/lib/gems/2.3.0/gems/raygun4ruby-1.1.9/lib/raygun/testable.rb:17:in `rescue in tracktestexception'

/var/lib/gems/2.3.0/gems/raygun4ruby-1.1.9/lib/raygun/testable.rb:8:in `tracktestexception'

/var/lib/gems/2.3.0/gems/raygun4ruby-1.1.9/lib/tasks/raygun.tasks:5:in `block (2 levels) in

Raygun::ItWorksException: Woohoo! Your Raygun<->Ruby connection is set up correctly

/var/lib/gems/2.3.0/gems/raygun4ruby-1.1.9/lib/raygun/testable.rb:9:in `tracktestexception'

/var/lib/gems/2.3.0/gems/raygun4ruby-1.1.9/lib/tasks/raygun.tasks:5:in `block (2 levels) in

Tasks: TOP => raygun:test

(See full trace by running task with --trace)

We are using AWS for our staging environment. It is surprising to me that Rails C works while through the app and rake test it does not.

When done through the Rails Console

irb(main):003:0> class ItWorksException < StandardError; end

=> nil

irb(main):004:0> e = ItWorksException.new("Woohoo! Your Raygun<->Ruby connection is set up correctly")

=> #

irb(main):005:0> response = Raygun.track_exception(e)

[Raygun] Tracking Exception...

=> #

irb(main):006:0> response.success?

=> true


Callum

Posted on
Jun 27 2016

Replied via Intercom


Reply