summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorJarka Kadlecova <jarka@gitlab.com>2017-07-26 09:57:56 +0200
committerJarka Kadlecova <jarka@gitlab.com>2017-07-27 07:51:36 +0200
commitaa2b3ff1e4c8bb725a96ed55906d142300ccf017 (patch)
tree5e834e50277c1c12a18e5dd1523eb8d93259d4de /app/models
parentf2da36f19661353cd1bd6788fbdf1a65e2d70f8d (diff)
downloadgitlab-ce-aa2b3ff1e4c8bb725a96ed55906d142300ccf017.tar.gz
Display specific error message when JIRA test fails32483-jira-error
Diffstat (limited to 'app/models')
-rw-r--r--app/models/project_services/jira_service.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/app/models/project_services/jira_service.rb b/app/models/project_services/jira_service.rb
index 37f2c96a22f..2aa19443198 100644
--- a/app/models/project_services/jira_service.rb
+++ b/app/models/project_services/jira_service.rb
@@ -160,7 +160,10 @@ class JiraService < IssueTrackerService
def test(_)
result = test_settings
- { success: result.present?, result: result }
+ success = result.present?
+ result = @error if @error && !success
+
+ { success: success, result: result }
end
# JIRA does not need test data.
@@ -288,7 +291,8 @@ class JiraService < IssueTrackerService
yield
rescue Timeout::Error, Errno::EINVAL, Errno::ECONNRESET, Errno::ECONNREFUSED, URI::InvalidURIError, JIRA::HTTPError, OpenSSL::SSL::SSLError => e
- Rails.logger.info "#{self.class.name} Send message ERROR: #{client_url} - #{e.message}"
+ @error = e.message
+ Rails.logger.info "#{self.class.name} Send message ERROR: #{client_url} - #{@error}"
nil
end