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:
authorRobert Schilling <rschilling@student.tugraz.at>2014-07-29 13:49:46 +0400
committerRobert Schilling <rschilling@student.tugraz.at>2014-07-29 13:49:46 +0400
commit7cefdb49eb460e87e3c3b827af32ae1b6834c4da (patch)
treeb1ce1dcdb146e094d5929b0c385495239cd8e663 /app/controllers/projects/hooks_controller.rb
parentd30454e112378c24cc9edfd7b511ca42bdb1e399 (diff)
Prevent 500 if hook url is down, fixes #7376
Diffstat (limited to 'app/controllers/projects/hooks_controller.rb')
-rw-r--r--app/controllers/projects/hooks_controller.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/app/controllers/projects/hooks_controller.rb b/app/controllers/projects/hooks_controller.rb
index c8269ed99ce..cab8fd76e6c 100644
--- a/app/controllers/projects/hooks_controller.rb
+++ b/app/controllers/projects/hooks_controller.rb
@@ -25,8 +25,13 @@ class Projects::HooksController < Projects::ApplicationController
def test
if !@project.empty_repo?
- TestHookService.new.execute(hook, current_user)
- flash[:notice] = 'Hook successfully executed.'
+ status = TestHookService.new.execute(hook, current_user)
+ if status
+ flash[:notice] = 'Hook successfully executed.'
+ else
+ flash[:alert] = 'Hook execution failed. '\
+ 'Ensure hook URL is correct and service is up.'
+ end
else
flash[:alert] = 'Hook execution failed. Ensure the project has commits.'
end