summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2018-10-22 11:57:55 +0200
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2018-10-22 11:57:55 +0200
commite26a30e5cef35b3ba7c920b941498c2ed16c54ee (patch)
tree989ab9cd0f772a9baeadc8ad3e0f05cbb4cfd311 /lib
parent380f63bf8d9b7f568c3958f6d0caeb0c05e712ac (diff)
downloadgitlab-ce-e26a30e5cef35b3ba7c920b941498c2ed16c54ee.tar.gz
Improve error message when `include` is blocked
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/ci/config/external/file/remote.rb8
1 files changed, 3 insertions, 5 deletions
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?