diff options
Diffstat (limited to 'app/controllers/projects')
-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 |