Cannot send exceptions to Raygun with Rails
Tim
Posted on
Aug 08 2014
Hi
Our rails app seems to have stopped sending exceptions to Raygun.
To isolate it I have made a new barebones rails application and connected it to a new Raygun application. If I go rake Raygun:test
then I see the Woohoo! Your Raygun<->Ruby connection is set up correctly come through as expected.
But if I try and create an exception such as
class WelcomeController < ApplicationController
def index
raise "Hi"
end
end
or
class WelcomeController < ApplicationController
def index
File.open("/etc/hosts") {|f| f << "example"}
end
end
I just see it in the browser. If put in Raygun.track_exception(e)
class WelcomeController < ApplicationController
def index
begin
raise "Hi"
rescue Exception => e
Raygun.track_exception(e)
end
end
end
Then I do not see the exception in the browser or Raygun
I have tried with the raygun4ruby gem 1.1.3 and 1.0.0.
Can you point out where I am going wrong?
Cheers, Tim
Callum
Posted on
Aug 08 2014
Hi Tim,
Just confirming that the gem was indeed previously transmitting exceptions correctly? Your final example in WelcomeController looks correct once the indentation has been fixed (assume this is just a copy/paste bug). Have any other gems been installed recently that may be monkey patching framework objects?
For a diagnostic you could place something like
print "Loaded" if defined?(Raygun)
and see if it is available in your controller. You also shouldn't need to rescue the exception - merely raising one should enable it to be caught by Raygun if the gem is configured correctly.
I will have a deeper investigation into this early next week for you.
Tim
Posted on
Aug 08 2014
Hi Callum,
Thanks for the reply. Yes it was previously working, out last error came through 4 days ago (excluding the connection test ones). Sorry about my copy/paste error, I missed the code button the first time around. We don't think there have been any gems installed recently that would affect it. My test case gem file just has
gem 'rails', '3.1.12'
gem 'sqlite3'
gem 'jquery-rails'
gem 'raygun4ruby'
If I put the print in it shows Loaded as expected.
I have shared the app I used to test, without the api key at: https://bitbucket.org/n00begon/rayguntest/
Thanks for investigating,
Cheers, Tim
Tim
Posted on
Aug 13 2014
Hi Callum,
How is the investigation for this going?
Cheers,
Tim