Browse Source

Fixed javascript error reporting

development
Godwin 8 years ago
parent
commit
bc556d6884
  1. 9
      app/controllers/application_controller.rb

9
app/controllers/application_controller.rb

@ -150,8 +150,7 @@ class ApplicationController < LinguaFrancaApplicationController
begin begin
# log the error # log the error
logger.info exception.to_s logger.info "Javascript exception: #{params[:message]}"
logger.info exception.backtrace.join("\n")
UserMailer.send_mail(:error_report) do UserMailer.send_mail(:error_report) do
[ [
@ -164,8 +163,8 @@ class ApplicationController < LinguaFrancaApplicationController
current_user, current_user,
Time.now.strftime("%d/%m/%Y %H:%M") Time.now.strftime("%d/%m/%Y %H:%M")
] ]
end if Rails.env.preview? || Rails.env.production? end# if Rails.env.preview? || Rails.env.production?
rescue exception2 rescue Exception => exception2
logger.info exception2.to_s logger.info exception2.to_s
logger.info exception2.backtrace.join("\n") logger.info exception2.backtrace.join("\n")
end end
@ -484,7 +483,7 @@ class ApplicationController < LinguaFrancaApplicationController
Time.now.strftime("%d/%m/%Y %H:%M") Time.now.strftime("%d/%m/%Y %H:%M")
] ]
end if Rails.env.preview? || Rails.env.production? end if Rails.env.preview? || Rails.env.production?
rescue exception2 rescue Exception => exception2
logger.info exception2.to_s logger.info exception2.to_s
logger.info exception2.backtrace.join("\n") logger.info exception2.backtrace.join("\n")
end end

Loading…
Cancel
Save