diff options
Diffstat (limited to 'app/services')
-rw-r--r-- | app/services/spam/akismet_service.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/app/services/spam/akismet_service.rb b/app/services/spam/akismet_service.rb index 4e56972ccd5..e9843497dd7 100644 --- a/app/services/spam/akismet_service.rb +++ b/app/services/spam/akismet_service.rb @@ -20,14 +20,18 @@ module Spam created_at: DateTime.current, author: owner_name, author_email: owner_email, - referer: options[:referer] + referrer: options[:referer] } begin is_spam, is_blatant = akismet_client.check(options[:ip_address], options[:user_agent], params) is_spam || is_blatant + rescue ArgumentError => e + Gitlab::ErrorTracking.track_and_raise_for_dev_exception(e) + false rescue StandardError => e - Gitlab::AppLogger.error("Unable to connect to Akismet: #{e}, skipping check") + Gitlab::ErrorTracking.track_exception(e) + Gitlab::AppLogger.error("Error during Akismet spam check, flagging as not spam: #{e}") false end end |