Commit 245c4820 authored by Vasilii Iakliushin's avatar Vasilii Iakliushin

Don't notify Sentry about PreReceiveErrors

* Contributes to https://gitlab.com/gitlab-org/gitlab/-/issues/351520
* Sentry error: https://sentry.gitlab.net/gitlab/gitlabcom/issues/3170457

The PreReceive error is not an exception and logging it only in Kibana
should be enough.

Changelog: changed
parent 63a7d839
......@@ -21,7 +21,7 @@ module Branches
error("Failed to create branch '#{branch_name}': invalid reference name '#{ref}'")
end
rescue Gitlab::Git::PreReceiveError => e
Gitlab::ErrorTracking.track_exception(e, pre_receive_message: e.raw_message, branch_name: branch_name, ref: ref)
Gitlab::ErrorTracking.log_exception(e, pre_receive_message: e.raw_message, branch_name: branch_name, ref: ref)
error(e.message)
end
......
......@@ -65,7 +65,7 @@ RSpec.describe Branches::CreateService do
allow(project.repository).to receive(:add_branch).and_raise(pre_receive_error)
expect(Gitlab::ErrorTracking).to receive(:track_exception).with(
expect(Gitlab::ErrorTracking).to receive(:log_exception).with(
pre_receive_error,
pre_receive_message: raw_message,
branch_name: 'new-feature',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment