Commit ad5a179b authored by James Fargher's avatar James Fargher

Merge branch 'sh-update-importer-log-error-field' into 'master'

Use error.message instead of error in importer.log

See merge request gitlab-org/gitlab!36104
parents 763e98b6 7cd88c54
......@@ -26,7 +26,7 @@ module Projects
message: 'Project housekeeping failed',
project_full_path: @project.full_path,
project_id: @project.id,
error: e.message
'error.message' => e.message
)
end
......
---
title: Use error.message instead of error in importer.log
merge_request: 36104
author:
type: fixed
......@@ -72,6 +72,26 @@ RSpec.describe Projects::AfterImportService do
end
end
context 'when housekeeping service lease is taken' do
let(:exception) { Projects::HousekeepingService::LeaseTaken.new }
it 'logs the error message' do
allow_next_instance_of(Projects::HousekeepingService) do |instance|
expect(instance).to receive(:execute).and_raise(exception)
end
expect(Gitlab::Import::Logger).to receive(:info).with(
{
message: 'Project housekeeping failed',
project_full_path: project.full_path,
project_id: project.id,
'error.message' => exception.to_s
}).and_call_original
subject.execute
end
end
context 'when after import action throw retriable exception one time' do
let(:exception) { GRPC::DeadlineExceeded.new }
......
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