Commit 10917086 authored by Arturo Herrero's avatar Arturo Herrero

Revert "More verbose JiraService error logs"

This partially reverts commit 8944a2f8.
parent cb4da55d
...@@ -435,15 +435,7 @@ class JiraService < IssueTrackerService ...@@ -435,15 +435,7 @@ class JiraService < IssueTrackerService
yield yield
rescue Timeout::Error, Errno::EINVAL, Errno::ECONNRESET, Errno::ECONNREFUSED, URI::InvalidURIError, JIRA::HTTPError, OpenSSL::SSL::SSLError => error rescue Timeout::Error, Errno::EINVAL, Errno::ECONNRESET, Errno::ECONNREFUSED, URI::InvalidURIError, JIRA::HTTPError, OpenSSL::SSL::SSLError => error
@error = error @error = error
log_error( log_error("Error sending message", client_url: client_url, error: @error.message)
"Error sending message",
client_url: client_url,
error: {
exception_class: error.class.name,
exception_message: error.message,
exception_backtrace: Gitlab::BacktraceCleaner.clean_backtrace(error.backtrace)
}
)
nil nil
end end
......
...@@ -688,22 +688,18 @@ describe JiraService do ...@@ -688,22 +688,18 @@ describe JiraService do
context 'when the test fails' do context 'when the test fails' do
it 'returns result with the error' do it 'returns result with the error' do
test_url = 'http://jira.example.com/rest/api/2/serverInfo' test_url = 'http://jira.example.com/rest/api/2/serverInfo'
error_message = 'Some specific failure.'
WebMock.stub_request(:get, test_url).with(basic_auth: [username, password]) WebMock.stub_request(:get, test_url).with(basic_auth: [username, password])
.to_raise(JIRA::HTTPError.new(double(message: 'Some specific failure.'))) .to_raise(JIRA::HTTPError.new(double(message: error_message)))
expect(jira_service).to receive(:log_error).with( expect(jira_service).to receive(:log_error).with(
"Error sending message", 'Error sending message',
hash_including( client_url: 'http://jira.example.com',
client_url: url, error: error_message
error: hash_including(
exception_class: 'JIRA::HTTPError',
exception_message: 'Some specific failure.'
)
)
) )
expect(jira_service.test(nil)).to eq(success: false, result: 'Some specific failure.') expect(jira_service.test(nil)).to eq(success: false, result: error_message)
end end
end end
end end
......
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