From d3a240464d36651f45f486ae2f93a953a5054c4c Mon Sep 17 00:00:00 2001 From: Bilal Date: Mon, 6 Jul 2020 15:37:59 +0200 Subject: [PATCH] manually report exception to sentry --- app/controllers/api/api_controller.rb | 4 +++- app/controllers/api/user_token_controller.rb | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/controllers/api/api_controller.rb b/app/controllers/api/api_controller.rb index 91ecb0b..db8928b 100644 --- a/app/controllers/api/api_controller.rb +++ b/app/controllers/api/api_controller.rb @@ -17,7 +17,9 @@ class Api::ApiController < ActionController::Base def return_error(exception) raise exception if Rails.env.test? - logger.error "==Handled=======" + Raven.capture_exception(exception) + + logger.error "==Handled======" logger.error exception.message logger.error exception.backtrace.join("\n") logger.error "==Handled=======" diff --git a/app/controllers/api/user_token_controller.rb b/app/controllers/api/user_token_controller.rb index 835af36..c9ab895 100644 --- a/app/controllers/api/user_token_controller.rb +++ b/app/controllers/api/user_token_controller.rb @@ -5,6 +5,8 @@ class Api::UserTokenController < Knock::AuthTokenController # Catch exception and return JSON-formatted error def return_error(exception) + Raven.capture_exception(exception) + logger.error "==Handled=======" logger.error exception.message logger.error exception.backtrace.join("\n")