diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-05 09:10:14 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-05 09:10:14 +0300 |
commit | 35cccb0c12024672d5a6e003fb0fb920fc9a323f (patch) | |
tree | 009d84b45e16814a0efc9d6ec4e7bc67ae54aa4a /app/services/spam | |
parent | 39ff150be056783165c2006babd5111e9b869548 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/services/spam')
-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 |