Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2015-08-12 10:40:54 +0300
committerStan Hu <stanhu@gmail.com>2015-08-12 17:31:25 +0300
commit23790570026ce78e3b4cbbf1b2f32ada992c5f40 (patch)
tree01ca42d07aa5d3d7a12d37767a8de3e8e4e55a7d /app/controllers/projects/services_controller.rb
parentcb6ad67f52c9e849e0f8ca34b2fff47c585bd816 (diff)
Provide more feedback what went wrong if HipChat service failed test
Issue gitlab-com/support-forum#213
Diffstat (limited to 'app/controllers/projects/services_controller.rb')
-rw-r--r--app/controllers/projects/services_controller.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/app/controllers/projects/services_controller.rb b/app/controllers/projects/services_controller.rb
index 1e435be8275..01105532479 100644
--- a/app/controllers/projects/services_controller.rb
+++ b/app/controllers/projects/services_controller.rb
@@ -39,10 +39,13 @@ class Projects::ServicesController < Projects::ApplicationController
def test
data = Gitlab::PushDataBuilder.build_sample(project, current_user)
- if @service.execute(data)
+ outcome = @service.test(data)
+ if outcome[:success]
message = { notice: 'We sent a request to the provided URL' }
else
- message = { alert: 'We tried to send a request to the provided URL but an error occured' }
+ error_message = "We tried to send a request to the provided URL but an error occurred"
+ error_message << ": #{outcome[:result]}" if outcome[:result].present?
+ message = { alert: error_message }
end
redirect_to :back, message