Skip to content
代码片段 群组 项目
未验证 提交 87498b30 编辑于 作者: Mehmet Emin INAC's avatar Mehmet Emin INAC 提交者: GitLab
浏览文件

Merge branch 'bwill/track-auto-resolve-exceptions' into 'master'

Add error tracking for auto-resolve

See merge request https://gitlab.com/gitlab-org/gitlab/-/merge_requests/184344



Merged-by: default avatarMehmet Emin INAC <minac@gitlab.com>
Approved-by: default avatarMehmet Emin INAC <minac@gitlab.com>
Co-authored-by: default avatarBrian Williams <bwilliams@gitlab.com>
No related branches found
No related tags found
2 合并请求!3031Merge per-main-jh to main-jh by luzhiyuan,!3030Merge per-main-jh to main-jh
...@@ -19,7 +19,9 @@ def execute ...@@ -19,7 +19,9 @@ def execute
refresh_statistics refresh_statistics
ServiceResponse.success(payload: { count: vulnerabilities_to_resolve.size }) ServiceResponse.success(payload: { count: vulnerabilities_to_resolve.size })
rescue ActiveRecord::ActiveRecordError rescue ActiveRecord::ActiveRecordError => e
Gitlab::ErrorTracking.track_exception(e)
error_response error_response
end end
......
...@@ -143,7 +143,8 @@ ...@@ -143,7 +143,8 @@
allow(Note).to receive(:insert_all!).and_raise(ActiveRecord::RecordNotUnique) allow(Note).to receive(:insert_all!).and_raise(ActiveRecord::RecordNotUnique)
end end
it 'does not bubble up the error' do it 'does not bubble up the error and tracks the exception' do
expect(Gitlab::ErrorTracking).to receive(:track_exception).with(ActiveRecord::RecordNotUnique)
expect { service.execute }.not_to raise_error expect { service.execute }.not_to raise_error
end end
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册