From e26a30e5cef35b3ba7c920b941498c2ed16c54ee Mon Sep 17 00:00:00 2001 From: Grzegorz Bizon Date: Mon, 22 Oct 2018 11:57:55 +0200 Subject: Improve error message when `include` is blocked --- lib/gitlab/ci/config/external/file/remote.rb | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'lib') diff --git a/lib/gitlab/ci/config/external/file/remote.rb b/lib/gitlab/ci/config/external/file/remote.rb index 23dfc5d9d44..86fa5ad8800 100644 --- a/lib/gitlab/ci/config/external/file/remote.rb +++ b/lib/gitlab/ci/config/external/file/remote.rb @@ -31,14 +31,12 @@ module Gitlab errors.push("Remote file `#{location}` could not be fetched because of a timeout error!") rescue Gitlab::HTTP::Error errors.push("Remote file `#{location}` could not be fetched because of HTTP error!") - rescue Gitlab::HTTP::BlockedUrlError - errors.push("Remote file `#{location}` could not be fetched because the URL is blocked!") + rescue Gitlab::HTTP::BlockedUrlError => e + errors.push("Remote file could not be fetched because #{e}!") end if response&.code.to_i >= 400 - errors.push <<~ERROR - Remote file `#{location}` could not be fetched because of HTTP code `#{response.code}` error! - ERROR + errors.push("Remote file `#{location}` could not be fetched because of HTTP code `#{response.code}` error!") end response.to_s if errors.none? -- cgit v1.2.1