Added rescue to show a custom error when testing project integrations

This commit is contained in:
Francisco Javier López 2018-03-29 08:23:47 +02:00 committed by Douwe Maan
parent 2e3bc6a941
commit 7143bb8852
No known key found for this signature in database
GPG Key ID: 5976703F65143D36
1 changed files with 2 additions and 0 deletions

View File

@ -46,6 +46,8 @@ class Projects::ServicesController < Projects::ApplicationController
else
{ error: true, message: 'Validations failed.', service_response: @service.errors.full_messages.join(',') }
end
rescue Gitlab::HTTP::BlockedUrlError => e
{ error: true, message: 'Test failed.', service_response: e.message }
end
def success_message