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

View file

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