summaryrefslogtreecommitdiff
path: root/app
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
parentf2da36f19661353cd1bd6788fbdf1a65e2d70f8d (diff)
downloadgitlab-ce-aa2b3ff1e4c8bb725a96ed55906d142300ccf017.tar.gz
Display specific error message when JIRA test fails32483-jira-error
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/integrations/integration_settings_form.js2
-rw-r--r--app/models/project_services/jira_service.rb8
2 files changed, 7 insertions, 3 deletions
diff --git a/app/assets/javascripts/integrations/integration_settings_form.js b/app/assets/javascripts/integrations/integration_settings_form.js
index ddd3a6aab99..cf1e6a14725 100644
--- a/app/assets/javascripts/integrations/integration_settings_form.js
+++ b/app/assets/javascripts/integrations/integration_settings_form.js
@@ -102,7 +102,7 @@ export default class IntegrationSettingsForm {
})
.done((res) => {
if (res.error) {
- new Flash(res.message, null, null, {
+ new Flash(`${res.message} ${res.service_response}`, null, null, {
title: 'Save anyway',
clickHandler: (e) => {
e.preventDefault();
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