Commit 48fd4f43 authored by Dan Jensen's avatar Dan Jensen Committed by Stan Hu

Report errors raised by Projects::DestroyService

Previously most errors raised by Projects::DestroyService were not
reported, only logged. That meant we were effectively discarding the
backtrace, which we have found that we need for pinpointing the source
of certain errors. This adds error reporting to the service to equip us
for faster, more efficient troubleshooting.
parent fcc42e80
......@@ -41,6 +41,8 @@ module Projects
true
rescue StandardError => error
context = Gitlab::ApplicationContext.current.merge(project_id: project.id)
Gitlab::ErrorTracking.track_exception(error, **context)
attempt_rollback(project, error.message)
false
rescue Exception => error # rubocop:disable Lint/RescueException
......
......@@ -78,6 +78,11 @@ RSpec.describe Projects::DestroyService, :aggregate_failures do
end.not_to raise_error
end
it 'reports the error' do
expect(Gitlab::ErrorTracking).to receive(:track_exception).and_call_original
destroy_project(project, user, {})
end
it 'unmarks the project as "pending deletion"' do
destroy_project(project, user, {})
......
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