From 2026abeb9a855e2e6e81cf1c9a7908ef0e98d1d5 Mon Sep 17 00:00:00 2001 From: Evandro Junior Date: Tue, 14 Jul 2015 18:40:11 -0300 Subject: [PATCH] Captures exception and then logs it --- lib/noosfero/api/helpers.rb | 3 +++ 1 file changed, 3 insertions(+), 0 deletions(-) diff --git a/lib/noosfero/api/helpers.rb b/lib/noosfero/api/helpers.rb index c56b2c3..adce98e 100644 --- a/lib/noosfero/api/helpers.rb +++ b/lib/noosfero/api/helpers.rb @@ -321,6 +321,7 @@ begin body = https.request(request).body rescue Exception => e + logger = Logger.new(File.join(Rails.root, 'log', "#{ENV['RAILS_ENV'] || 'production'}_api.log")) logger.error e return _("Google recaptcha error: #{e.message}") end @@ -346,6 +347,7 @@ begin body = https.request(request).body rescue Exception => e + logger = Logger.new(File.join(Rails.root, 'log', "#{ENV['RAILS_ENV'] || 'production'}_api.log")) logger.error e return _("Google recaptcha error: #{e.message}") end @@ -364,6 +366,7 @@ begin body = http.request(request).body rescue Exception => e + logger = Logger.new(File.join(Rails.root, 'log', "#{ENV['RAILS_ENV'] || 'production'}_api.log")) logger.error e return _("Serpro captcha error: #{e.message}") end -- libgit2 0.21.2