diff options
author | Stan Hu <stanhu@gmail.com> | 2015-08-12 00:40:54 -0700 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2015-08-12 07:31:25 -0700 |
commit | 23790570026ce78e3b4cbbf1b2f32ada992c5f40 (patch) | |
tree | 01ca42d07aa5d3d7a12d37767a8de3e8e4e55a7d /app/controllers/projects/services_controller.rb | |
parent | cb6ad67f52c9e849e0f8ca34b2fff47c585bd816 (diff) | |
download | gitlab-ce-23790570026ce78e3b4cbbf1b2f32ada992c5f40.tar.gz |
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.rb | 7 |
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 |