@ -130,7 +130,8 @@ class ApplicationController < LinguaFrancaApplicationController
logger.infoexception.to_s
logger.infoexception.to_s
logger.infoexception.backtrace.join("\n")
logger.infoexception.backtrace.join("\n")
UserMailer.delay.error_report(
UserMailer.send_mail(:error_report)do
[
"A JavaScript error has occurred",
"A JavaScript error has occurred",
report,
report,
params[:message],
params[:message],
@ -138,7 +139,8 @@ class ApplicationController < LinguaFrancaApplicationController
request,
request,
params,
params,
current_user,
current_user,
)ifRails.env.preview?||Rails.env.production?
]
endifRails.env.preview?||Rails.env.production?
end
end
renderjson:{}
renderjson:{}
end
end
@ -185,7 +187,8 @@ class ApplicationController < LinguaFrancaApplicationController
# send and email if this is production
# send and email if this is production
suppress(Exception)do
suppress(Exception)do
UserMailer.delay.error_report(
UserMailer.send_mail(:error_report)do
[
"An error has occurred in #{Rails.env}",
"An error has occurred in #{Rails.env}",
nil,
nil,
exception.to_s,
exception.to_s,
@ -193,7 +196,8 @@ class ApplicationController < LinguaFrancaApplicationController
request,
request,
params,
params,
current_user,
current_user,
)ifRails.env.preview?||Rails.env.production?
]
endifRails.env.preview?||Rails.env.production?
end
end
# raise the error if we are in development so that we can debug it
# raise the error if we are in development so that we can debug it
@ -335,7 +339,8 @@ class ApplicationController < LinguaFrancaApplicationController
defi18n_exception(str,exception,locale,key)
defi18n_exception(str,exception,locale,key)
# send and email if this is production
# send and email if this is production
suppress(Exception)do
suppress(Exception)do
UserMailer.delay.error_report(
UserMailer.send_mail(:error_report)do
[
"A missing translation found in #{Rails.env}",
"A missing translation found in #{Rails.env}",
"<p>A translation for <code>#{key}</code> in <code>#{locale.to_s}</code> was found. The text that was rendered to the user was:</p><blockquote>#{str||'nil'}</blockquote>",
"<p>A translation for <code>#{key}</code> in <code>#{locale.to_s}</code> was found. The text that was rendered to the user was:</p><blockquote>#{str||'nil'}</blockquote>",
exception.to_s,
exception.to_s,
@ -343,7 +348,8 @@ class ApplicationController < LinguaFrancaApplicationController
request,
request,
params,
params,
current_user,
current_user,
)ifRails.env.preview?||Rails.env.production?
]
endifRails.env.preview?||Rails.env.production?
logger.info"Missing translation found for: #{key}"
logger.info"Missing translation found for: #{key}"