From bc556d688471fb73dc554d3ceae3800331290824 Mon Sep 17 00:00:00 2001 From: Godwin Date: Tue, 27 Dec 2016 02:37:57 -0800 Subject: [PATCH] Fixed javascript error reporting --- app/controllers/application_controller.rb | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index c8adbe4..a1093f0 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -150,8 +150,7 @@ class ApplicationController < LinguaFrancaApplicationController begin # log the error - logger.info exception.to_s - logger.info exception.backtrace.join("\n") + logger.info "Javascript exception: #{params[:message]}" UserMailer.send_mail(:error_report) do [ @@ -164,8 +163,8 @@ class ApplicationController < LinguaFrancaApplicationController current_user, Time.now.strftime("%d/%m/%Y %H:%M") ] - end if Rails.env.preview? || Rails.env.production? - rescue exception2 + end# if Rails.env.preview? || Rails.env.production? + rescue Exception => exception2 logger.info exception2.to_s logger.info exception2.backtrace.join("\n") end @@ -484,7 +483,7 @@ class ApplicationController < LinguaFrancaApplicationController Time.now.strftime("%d/%m/%Y %H:%M") ] end if Rails.env.preview? || Rails.env.production? - rescue exception2 + rescue Exception => exception2 logger.info exception2.to_s logger.info exception2.backtrace.join("\n") end