Skip to content
Snippets Groups Projects
Commit 861d1d50 authored by Cleber Rosa's avatar Cleber Rosa Committed by Thomas Huth
Browse files

scripts/ci/gitlab-pipeline-status: give more information on failures


When an HTTP GET request fails, it's useful to go beyond the "not
successful" message, and show the code returned by the server.

Signed-off-by: default avatarCleber Rosa <crosa@redhat.com>
Reviewed-by: default avatarAlex Bennée <alex.bennee@linaro.org>
Reviewed-by: default avatarWainer dos Santos Moschetta <wainersm@redhat.com>
Message-Id: <20210222193240.921250-3-crosa@redhat.com>
Signed-off-by: default avatarThomas Huth <thuth@redhat.com>
parent 2faf56bd
No related branches found
No related tags found
No related merge requests found
......@@ -56,7 +56,9 @@ def get_json_http_response(url):
connection.request('GET', url=url)
response = connection.getresponse()
if response.code != http.HTTPStatus.OK:
raise CommunicationFailure("Failed to receive a successful response")
msg = "Received unsuccessful response: %s (%s)" % (response.code,
response.reason)
raise CommunicationFailure(msg)
return json.loads(response.read())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment