diff options
author | Jarka Kadlecova <jarka@gitlab.com> | 2017-07-26 10:57:56 +0300 |
---|---|---|
committer | Jarka Kadlecova <jarka@gitlab.com> | 2017-07-27 08:51:36 +0300 |
commit | aa2b3ff1e4c8bb725a96ed55906d142300ccf017 (patch) | |
tree | 5e834e50277c1c12a18e5dd1523eb8d93259d4de /app/models/project_services/jira_service.rb | |
parent | f2da36f19661353cd1bd6788fbdf1a65e2d70f8d (diff) |
Display specific error message when JIRA test fails
Diffstat (limited to 'app/models/project_services/jira_service.rb')
-rw-r--r-- | app/models/project_services/jira_service.rb | 8 |
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 |