Commit fff31020 authored by Stan Hu's avatar Stan Hu

Merge branch '349414-track-exceptions-in-projects-destroy-service' into 'master'

Report errors raised by Projects::DestroyService

See merge request gitlab-org/gitlab!77907
parents 50df24e4 48fd4f43
...@@ -41,6 +41,8 @@ module Projects ...@@ -41,6 +41,8 @@ module Projects
true true
rescue StandardError => error rescue StandardError => error
context = Gitlab::ApplicationContext.current.merge(project_id: project.id)
Gitlab::ErrorTracking.track_exception(error, **context)
attempt_rollback(project, error.message) attempt_rollback(project, error.message)
false false
rescue Exception => error # rubocop:disable Lint/RescueException rescue Exception => error # rubocop:disable Lint/RescueException
......
...@@ -78,6 +78,11 @@ RSpec.describe Projects::DestroyService, :aggregate_failures do ...@@ -78,6 +78,11 @@ RSpec.describe Projects::DestroyService, :aggregate_failures do
end.not_to raise_error end.not_to raise_error
end 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 it 'unmarks the project as "pending deletion"' do
destroy_project(project, user, {}) 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