From 2ded8ac2be61df1baf11ec85749f8ad79d1749cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9e=20Hendricksen?= Date: Mon, 30 May 2016 17:16:27 +0200 Subject: [PATCH] some changes to get errors to report to Sentry --- lib/travis/api/app.rb | 4 ++-- lib/travis/api/app/error_handling.rb | 2 +- script/console | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/travis/api/app.rb b/lib/travis/api/app.rb index 624b3fc7..ad8575df 100644 --- a/lib/travis/api/app.rb +++ b/lib/travis/api/app.rb @@ -102,7 +102,7 @@ module Travis::Api use(Rack::Config) { |env| env['metriks.request.start'] ||= Time.now.utc } use Travis::Api::App::Cors # if Travis.env == 'development' ??? - use Raven::Rack if Travis.env == 'production' || Travis.env == 'staging' + use Raven::Rack if Travis::Api::App.use_monitoring? use Rack::SSL if Endpoint.production? use ActiveRecord::ConnectionAdapters::ConnectionManagement use ActiveRecord::QueryCache @@ -192,7 +192,7 @@ module Travis::Api end end - if use_monitoring? and not console? + if use_monitoring? && !console setup_monitoring end end diff --git a/lib/travis/api/app/error_handling.rb b/lib/travis/api/app/error_handling.rb index 68e69556..28e6fab3 100644 --- a/lib/travis/api/app/error_handling.rb +++ b/lib/travis/api/app/error_handling.rb @@ -9,7 +9,7 @@ class Travis::Api::App Thread.new do loop do begin - Raven.send queue.pop + Raven.send :send_event, queue.pop rescue Exception => e puts e.message, e.backtrace end diff --git a/script/console b/script/console index a6b9aed7..4fcc042b 100755 --- a/script/console +++ b/script/console @@ -16,7 +16,7 @@ end V3 = Travis::API::V3 -Travis::Api::App.setup +Travis::Api::App.new console = Travis::Console.new methods = Travis::Console.instance_methods - Object.instance_methods